Skip to content

Instantly share code, notes, and snippets.

@jonasbn
Last active August 26, 2018 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonasbn/030008b965bebad2bb896aeb5518e07b to your computer and use it in GitHub Desktop.
Save jonasbn/030008b965bebad2bb896aeb5518e07b to your computer and use it in GitHub Desktop.
#!/bin/bash
say -v Samantha "Docker build commencing...";
# Receives: messages and return value from Docker build
function emit() {
if [ $2 -eq 0 ]
then
# green output
echo -e "\033[92m$1";
else
# red output
echo -e "\033[91m$1";
fi
# Resetting colouring
echo -e "\033[0m";
hey $1;
}
alive-beep.sh &
./docker-build.sh
kill $!
if [ $? -eq 0 ]
then
/usr/bin/afplay $HOME/Sounds/success.wav
emit "Docker build completed" 0
else
/usr/bin/afplay $HOME/Sounds/warning.wav
emit "Docker build failed" 1
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment