Created
August 20, 2013 23:33
-
-
Save michaelneale/6288696 to your computer and use it in GitHub Desktop.
This file contains 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
# INSTALL AND CONFIGURE BEES SDK | |
export BEES_HOME=/opt/cloudbees/cloudbees-sdk/ | |
export PATH=$PATH:$BEES_HOME | |
if [ ! -d ~/.bees ]; then | |
bees init -f -a <account name> -ep us -k $BEES_API -s $BEES_SECRET | |
fi | |
bees plugin:install com.cloudbees.sdk.plugins:bg-plugin | |
# DEPLOY | |
bees app:bg:deploy -n <your app name> target/web-webapp.war | |
# WARM NEW SERVERS - for example - could be a smoke test here: | |
echo "Preparing new servers for router switch over..." | |
for i in {1..50} | |
do | |
curl -s "http://yourwebsite.com/" > /dev/null | |
sleep 5 | |
done | |
# SWITCH ROUTER | |
echo "Switching router over to new servers..." | |
bees app:bg:switch -n <your app name> -f | |
# SHUTDOWN OLD SERVERS | |
echo "Shutting down old servers..." | |
bees app:bg:stop -n int -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment