Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

vmware-archive/cf-bg-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cf-bg-demo

Demonstrate Blue-Green Deployments on Cloud Foundry with this simple (one Groovy file, one HTML file) Spring Boot CLI application!

Running Locally

$ spring run app.groovy

Running on Cloud Foundry

The application requires the latest version of the Java Buildpack, so we’ll use that from GitHub. Cloud Foundry requires unique URLs, so use the '-n' flag to define a unique HOSTNAME and add a short alphanumeric suffix.

$ $ cf push cf-scale-boot -m 512M -b https://github.com/cloudfoundry/java-buildpack -n cf-scale-boot-a123z

Doing a Blue-Green Demo

This application leverages the colors blue and green to demonstrate the dynamic routing and load balancing capabilities of Cloud Foundry in a Blue-Green Deployment Scenario.

Steps:

  1. Push the application as-is, with blue appended to the application name. Use '-n' to define a unique HOSTNAME:

    $ cf push cf-bg-demo-blue -m 512M -b https://github.com/cloudfoundry/java-buildpack -n cf-bg-demo-blue-a123z
  2. Map a ``zero downtime'' route to the application and use '-n' to define a unique HOSTNAME:

    cf map-route cf-bg-demo-blue cfapps.io -n cf-bg-demo-a123z

    Visit your application in the browser using your zero downtime route to see that it is working.

  3. Modify app.groovy to use the color green (line 8):

    model['color'] = 'green'
  4. Push the modified application, with green appended to the application name and again use '-n' to define a unique HOSTNAME:

    $ cf push cf-bg-demo-green -m 512M -b https://github.com/cloudfoundry/java-buildpack -n cf-bg-demo-green-a123z
  5. Map the ``zero downtime'' route to the modified application, including the HOSTNAME suffix you added in Step 2:

    cf map-route cf-bg-demo-green cfapps.io -n cf-bg-demo-a123z

    Visit your application in the browser using your zero downtime route to see that the platform is load balancing between the two instances.

  6. Un-map the ``zero downtime'' route from the original application, including the HOSTNAME suffix you added in Step 2:

    cf unmap-route cf-bg-demo-blue cfapps.io -n cf-bg-demo-a123z

    Visit your application in the browser using your zero downtime route to see that only the modified application is now in play.

What you get:

screenshot

About

Demonstrate Blue-Green Deployments on Cloud Foundry with this simple (one Groovy file, one HTML file) Spring Boot CLI application!

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •