forked from MapComplete/MapComplete
Add small autodeploy script
This commit is contained in:
parent
8f41e2d58c
commit
db54326ec9
1 changed files with 25 additions and 0 deletions
25
scripts/deployIfChanged.sh
Executable file
25
scripts/deployIfChanged.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#! /bin/bash
|
||||
|
||||
|
||||
# To run with crontab:
|
||||
# 1 * * * * /home/pietervdvn/git/MapComplete/scripts/deployIfChanged.sh >> /home/pietervdvn/auto_deploy_caching.log 2>&1
|
||||
|
||||
|
||||
ACTION='\033[1;90m'
|
||||
FINISHED='\033[1;96m'
|
||||
READY='\033[1;92m'
|
||||
NOCOLOR='\033[0m' # No Color
|
||||
ERROR='\033[0;31m'
|
||||
|
||||
|
||||
git fetch
|
||||
HEADHASH=$(git rev-parse HEAD)
|
||||
UPSTREAMHASH=$(git rev-parse master@{upstream})
|
||||
|
||||
if [ "$HEADHASH" != "$UPSTREAMHASH" ]
|
||||
then
|
||||
echo -e ${ACTION}Not up to date with origin. Deploying!${NOCOLOR}
|
||||
echo
|
||||
git pull
|
||||
npm run deploy:production
|
||||
fi
|
Loading…
Reference in a new issue