Last active
May 23, 2019 15:46
-
-
Save tonyc/8669e3ed522e1f59122c1f241a8d0851 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
#!/usr/bin/env bash | |
get_latest_sha () { | |
heroku releases --num 1 --remote $1 2> /dev/null | grep -v === | awk '{print $3}' | |
} | |
STAGING_SHA=$(get_latest_sha "staging") | |
PRODUCTION_SHA=$(get_latest_sha "production") | |
echo "Staging: $STAGING_SHA, Production: $PRODUCTION_SHA" | |
if [[ $STAGING_SHA == $PRODUCTION_SHA ]]; then | |
echo "Production is caught up to staging" | |
else | |
echo "Production is behind staging" | |
git log --no-decorate --date=short --pretty=format:"%Cred%h%Creset %Cgreen%ad%Creset %s" $PRODUCTION_SHA..$STAGING_SHA | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment