Skip to content

Instantly share code, notes, and snippets.

@bitops
Created March 13, 2018 14:42
Show Gist options
  • Save bitops/7c7547ccb3d87f4c9fcd7b7dddb128eb to your computer and use it in GitHub Desktop.
Save bitops/7c7547ccb3d87f4c9fcd7b7dddb128eb to your computer and use it in GitHub Desktop.
Simple blue-green cloud foundry deploy script
#!/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