anchor.diff:  ---
   title: Blue-Green Deployment
   ---
  +
  +_This page assumes you are using cf v6._
   
   Blue-green deployment is a release technique that reduces downtime and risk by
   running two identical production environments called Blue and Green.
  
positive.code: This app is a web page that displays the words "Blue time" and the date/time on
  the server.
  
  ### <a id='push-an-app'></a>Step 1: Push an App ###
  Use the `cf` command-line interface to push the application.
  Name the application "Blue" with the subdomain "demo-time."
  
  <pre class="terminal">
  cf push --path target/demo-time.war --name Blue --host demo-time
  </pre>
  
  As shown in the graphic below:
  
  * Blue is now running on Cloud Foundry.
  * The CF Router sends all traffic for demo-time.example.com traffic to Blue.
  
  <%= image_tag("../images/blue-green/blue.png") %>
  
  
negative.code: Now make a change to the application.
  First, replace the word "Blue" on the web page with "Green," then build a new
  WAR file for the application.
  Run `cf push` again, but use the name "Green" for the application and provide a
  different subdomain to create a temporary route:
  
  <pre class="terminal">
  cf push Green -p target/demo-time.war -n demo-time-temp
  </pre>
  
  After this cf push:
  
  * Two instances of our application are now running on Cloud Foundry: the
  original Blue and the updated Green.
  * The CF Router still sends all traffic for `demo-time.example.com` traffic to
  Blue.
  The router now also sends any traffic for `demo-time-temp.example.com` to Green.
  
  <%= image_tag("../images/blue-green/blue-green.png") %>
  
  