Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created March 9, 2021 10:52
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 AndrewVos/2fa1174f60c9faa953e0acf3ce887387 to your computer and use it in GitHub Desktop.
Save AndrewVos/2fa1174f60c9faa953e0acf3ce887387 to your computer and use it in GitHub Desktop.
Script to notify you when current HEAD is deployed to Heroku
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
echo "Waiting for Heroku release hash to equal HEAD..."
echo "Press [CTRL+C] to stop.."
while :
do
HEROKU_HASH=$(heroku releases | grep Deploy |head -n1 |cut -d ' ' -f4)
LOCAL_HASH=$(git rev-parse HEAD)
if [[ $LOCAL_HASH = $HEROKU_HASH* ]]; then
notify-send "Heroku is up to date"
break
fi
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment