Skip to content

Commit

Permalink
make sure the servers always get the latest configs
Browse files Browse the repository at this point in the history
  • Loading branch information
bsparks committed Dec 12, 2014
1 parent 893cf80 commit 14bcda0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 6 additions & 1 deletion update_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ cd /opt/ironbane-dev-server/
/usr/bin/git checkout master
/usr/bin/nodejs /opt/ironbane-ironbot/notify.js "running npm install" blue
/usr/bin/sudo npm install
/usr/bin/sudo cp /opt/ironbane-secret/ironbane-dev-settings/ibconfig.json ./config/config.json

# update and grab config values
cd /opt/ironbane-secret
/usr/bin/git pull
/usr/bin/sudo cp ./ironbane-dev-settings/ibconfig.json /opt/ironbane-dev-server/config/config.json

/usr/bin/sudo restart ironbane-dev-server
/usr/bin/nodejs /opt/ironbane-ironbot/notify.js "ironbane-dev-server up2date and restarted" yellow
12 changes: 8 additions & 4 deletions update_play.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
sleep 5
cd /opt/ironbane-play-server/
# Get new tags from remote
/usr/bin/sudo git fetch --tags
/usr/bin/git fetch --tags
# Get latest tag name
/usr/bin/sudo latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
/usr/bin/latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
# Checkout latest tag
/usr/bin/sudo git checkout $latestTag
/usr/bin/git checkout $latestTag
/usr/bin/sudo npm install
/usr/bin/sudo cp /opt/ironbane-secret/ironbane-play-settings/ibconfig.json ./config/config.json
# update and grab config values
cd /opt/ironbane-secret
/usr/bin/git pull
/usr/bin/sudo cp ./ironbane-play-settings/ibconfig.json /opt/ironbane-play-server/config/config.json

/usr/bin/sudo restart ironbane-play-server
/usr/bin/nodejs /opt/ironbane-ironbot/notify.js "ironbane-play-server up2date and restarted" red

0 comments on commit 14bcda0

Please sign in to comment.