Skip to content

Instantly share code, notes, and snippets.

@ariporad
Created May 6, 2016 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariporad/cf32382c44353a76699a0699e7ab96c2 to your computer and use it in GitHub Desktop.
Save ariporad/cf32382c44353a76699a0699e7ab96c2 to your computer and use it in GitHub Desktop.
Rover DevOps Challenge Solution
if [[ $# -eq 0 ]] ; then
echo 'Usage: $0 VERSION'
echo ''
echo 'Does a Zero-Downtime deploy of VERSION to worker, web-1 and web-2, including DB migrations.'
echo ''
exit 0
fi
ssh root@worker "./materialize $1 && ./db-migrate $1 && ./restart-worker"
ssh root@web-1 "./lb-remove && ./materialize $1 && ./db-migrate $1 && ./restart-web && ./lb-join"
ssh root@web-2 "./lb-remove && ./materialize $1 && ./db-migrate $1 && ./restart-web && ./lb-join"
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment