Created
January 8, 2018 15:16
-
-
Save johndstein/c81a0eb60b48a4f4a9cf199c88b6e7ab to your computer and use it in GitHub Desktop.
Check if Git up to date
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 | |
set -e | |
# | |
# Check and see if I have been updated. | |
# If not, do nothing. If yes, run my deployment script. | |
# | |
# We can run this every minute. | |
# crontab -e | |
# * * * * * /home/ubuntu/glo.sh/bin/pullme.sh >/dev/null 2>&1 | |
MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
cd $MY_DIR | |
cd .. | |
OUTPUT="$(git pull)" | |
if [[ "$OUTPUT" != *"Already up-to-date"* ]]; then | |
$MY_DIR/deploy.sh | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment