Created
March 13, 2018 14:42
-
-
Save bitops/7c7547ccb3d87f4c9fcd7b7dddb128eb to your computer and use it in GitHub Desktop.
Simple blue-green cloud foundry deploy script
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
#!/bin/bash | |
echo "Building app." | |
mvn clean package | |
echo "Pushing Blue." | |
cf push seb -f manifest.yml | |
echo "Pushing Green." | |
cf push seb-green -f manifest.yml | |
echo "Set up load balancing." | |
cf map-route seb-green cfapps.io --hostname seb | |
sleep 15 | |
echo "Sending all traffic to green." | |
cf unmap-route seb cfapps.io --hostname seb | |
sleep 15 | |
echo "Cleaning up." | |
cf delete -f seb | |
cf rename seb-green seb | |
echo "All done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment