Last active
August 26, 2018 13:20
-
-
Save jonasbn/030008b965bebad2bb896aeb5518e07b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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