anchor.diff:  
   <%=vars.GSG_intro_sentence%>
   
  -This guide is intended to walk you through deploying a Ratpack framework app to <%=vars.product_full%>. If at any time you experience a problem following the steps below, try checking the <%=vars.known_issues%> topic, or refer to the [Troubleshooting Application Deployment and Health](./../../devguide/deploy-apps/troubleshoot-app-health.html) topic for more tips.
  +This guide is intended to walk you through deploying a Ratpack app to <%=vars.product_full%>. If you experience a problem following the steps below,  check the <%=vars.known_issues%> topic or refer to the [Troubleshooting Application Deployment and Health](./../../devguide/deploy-apps/troubleshoot-app-health.html) topic.
   
   <p class="tip"><strong>Sample App Step</strong><br />If you want to go through this tutorial using the sample app, run <code>git clone git@github.com:camelpunch/pong_matcher_groovy.git</code> to clone the <code>pong_matcher_groovy</code> app from GitHub, and follow the instructions in the Sample App Step boxes.</p>
   
  +<p class="note"><strong>Note</strong>: Ensure that your Ratpack app runs locally before continuing with this procedure.</p>
  +
   ## <a id='deploy-yourapp'></a>Deploy a Ratpack Application ##
   
   This section describes how to deploy a Ratpack application to <%=vars.product_short%>.
  
positive.code: 
  
  
  ## Deploy a Ratpack Sample Application ##
  
  This section describes how to deploy a Ratpack sample application to <%=vars.product_short%>.
  
  To learn how to deploy your own Ratpack app, see [Deploy Your Ratpack Application](#deploy-yourapp).
  
  ### Prerequisites ###
  
  * [Git](http://git-scm.com) configured on your workstation and a [GitHub](https://github.com) account
  * Basic Ratpack knowledge
  * (**Optional**) [Spring Boot CLI](http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#cli) to run your Ratpack app locally
  
  ### Step 1: Get a Sample Ratpack App from GitHub ###
  
  Run `git clone https://github.com/cf-platform-eng/cf-bg-demo.git` to clone the `cf-bg-demo` app from GitHub.
  
  ### Step 2: Log in and Target the API Endpoint   ###
  Run `cf login -a [API_ENDPOINT]`, enter your login credentials, and select a space and org. The API endpoint is <%=vars.api_endpoint%>.
  
  ### Step 3: Deploy the Sample App ###
  
  1. `cd` to the cloned app directory.
  1. Complete all the steps in the **Doing a Blue-Green Demo** section of the [cf-platform-eng/cf-bg-demo README](https://github.com/cf-platform-eng/cf-bg-demo).
  
  If you want to run the app locally using the Spring Boot CLI, complete the **Running Locally** section.
  
    `cf push [APP_NAME]` pushes the specified app from the current directory to <%=vars.product_short%>. Use the `-n` or `--random-route` flag to create a unique URL for the app to avoid URL collisions with other apps.
  
    `cf push` automatically searches for an [application manifest YAML file](./../../devguide/deploy-apps/manifest.html) and also determines the appropriate [buildpack](./index.html) for the app. A manifest specifies what `cf push` should do with the app and the buildpack provides framework and runtime support for your app. 
  
    The example shows the terminal output of deploying the initial blue version of the app. Because this sample application does not have a manifest, the `-m` and `-b` flags substitute for the manifest and set the memory and buildpack location for the app. `cf push` uses these settings to create the app, create and bind and the route, and upload the app to <%=vars.product_short%>. It then starts one instance of the app with 512M. After the app starts, the output displays the health and status of the app.
  
  <pre class="terminal">
  $ cf push -m 512M -b https://github.com/cloudfoundry/java-buildpack --random-route cf-bg-demo-blue
  
  Creating app cf-bg-demo-blue in org Cloud-Apps / space development as clouduser@example.com...
  OK
  
  Creating route cf-bg-demo-blue-grouty-sarcode.<%=vars.app_domain%>...
  OK
  
  Binding cf-bg-demo-blue-grouty-sarcode.cfapps.io to cf-bg-demo-blue...
  OK
  
  Uploading cf-bg-demo-blue...
  Uploading app files from: /Users/pivotal/workspace/cf-bg-demo
  Uploading 262.9K, 19 files
  OK
  
  Starting app cf-bg-demo-blue in org Cloud-Apps / space development as clouduser@example.com...
  OK
  -----> Downloaded app package (576K)
  Cloning into '/tmp/buildpacks/java-buildpack'...
  -----> Java Buildpack Version: 840da8b | https://github.com/cloudfoundry/java-buildpack#840da8b
  -----> Downloading Open Jdk JRE 1.7.0_65 from http://download.run.pivotal.io/openjdk/lucid/x86_64/openjdk-1.7.0_65.tar.gz (1.2s)
         Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.1s)
  -----> Downloading Spring Boot CLI 1.1.5_RELEASE from http://download.run.pivotal.io/spring-boot-cli/spring-boot-cli-1.1.5_RELEASE.tar.gz (0.4s)
         Expanding Spring Boot CLI to .java-buildpack/spring_boot_cli (0.1s)
  -----> Uploading droplet (39M)
  
  0 of 1 instances running, 1 starting
  0 of 1 instances running, 1 starting
  1 of 1 instances running
  
  App started
  
  Showing health and status for app cf-bg-demo-blue in org Cloud-Apps / space development as clouduser@example.com...
  OK
  
  requested state: started
  instances: 1/1
  usage: 512M x 1 instances
  urls: cf-bg-demo-blue-grouty-sarcode.<%=vars.app_domain%>
  
  	     state     since                    cpu    memory           disk   
  	#0   running   2014-08-26 11:46:54 AM   0.0%   325.2M of 512M   114.5M of 1G
  </pre>
  
  ### Step 4: Test the Sample App ###
  
  You’ve deployed your first app to <%=vars.product_short%>!
  
  In Step 5 of the README instructions, you complete mapping both blue and green app versions to the zero downtime route. The composite image below shows the result of this mapping to the zero downtime route URL `cf-bg-demo-a1426.cfapps.io`. Refreshing the webpage causes the different app versions to display and demonstrates the <%=vars.product_short%> load balancing functionality in action.
  
  <%= image_tag("../images/blue_green_demo.png") %>
  
  Now let’s access your app online using its URL. In the terminal output, the `urls` field of the `App started` block contains the app URL. This is the `HOST_NAME` and alphanumeric suffix you specified with the `-n` flag plus the domain `<%=vars.app_domain%>`. Note that because you unmapped the blue app version from your zero downtime route URL in Step 6, only the green app version displays when you browse to this URL. Remap the blue app version to view both versions and test the <%=vars.product_short%> load balancing functionality.
  
  You can now use the `cf` <%=vars.dev_console_2%> to review information and administer your app and your <%=vars.product_short%> account. For example, you could increase the number of app instances from 1 to 3, and redeploy the app with a new app name and host name. 
  
  See the [Manage Your Application with the cf CLI](#cli-manage) section for more information. <%=vars.dev_console_4%>
  
  
   
   
   
   
   
negative.code: * Include the appropriate driver in your application.
  * Create a dependency task for the driver in the build script for your build tool or IDE.
  
  <p class="tip"><strong>Sample App Step</strong><br />You can skip this step. The <code>pong_matcher_groovy</code> sample app does not require a JDBC driver.</p>
  
  ### Step 6: Create and Bind a Service Instance for a Ratpack Application ###
  
  This section describes using the CLI to configure a Redis managed service instance for an app. <%=vars.dev_console_1%>
  
  <%=vars.product_short%> supports two types of service instances:
  
  * Managed services integrate with <%=vars.product_short%> through service brokers that offer services and plans and manage the service calls between <%=vars.product_short%> and a service provider.
  * User-provided service instances enable you to connect your application to pre-provisioned external service instances.
  
  For more information on creating and using service instances, refer to the [Services Overview](./../../devguide/services/index.html) topic.
  
  #### Create a Service Instance ####
  
  Run `cf marketplace` to view managed and user-provided services and plans available to you.
  
  The example shows two of the available managed database-as-a-service providers and their offered plans: `elephantsql` PostgreSQL as a Service and `rediscloud` Enterprise-Class Redis for Developers.
  
  <pre class="terminal">
  $  cf marketplace
  Getting services from marketplace in org Cloud-Apps / space development as clouduser@example.com...
  OK
  
  service       plans        description
  ...
  
  elephantsql   turtle, panda, elephant      PostgreSQL as a Service
  ...
  rediscloud    25mb, 100mb, 1gb, 10gb, 50gb Enterprise-Class Redis for Developers
  ...
  
  </pre>
  
  Run `cf create-service [SERVICE] [PLAN] [SERVICE_INSTANCE]` to create a service instance for your app. Choose a SERVICE and PLAN from the list, and provide a unique name for the SERVICE_INSTANCE.
  
  <p class="tip"><strong>Sample App Step</strong><br />Run <code>cf create-service rediscloud 25mb baby-redis</code>. This creates a service instance named <code>baby-redis</code> that uses the <code>rediscloud</code> service and the <code>25mb</code> plan, as the example below shows.
  
  <pre class="terminal">
  $ cf create-service rediscloud 25mb baby-redis
  Creating service baby-redis in org Cloud-Apps / space development as clouduser@example.com....
  OK
  </pre>
  </p>
  
  #### Bind a Service Instance ####
  
  When you bind an app to a service instance, <%=vars.product_short%> writes information about the service instance to the VCAP_SERVICES app environment variable. The app can use this information to integrate with the service instance.
  
  Most services support bindable service instances. Refer to your service provider's documentation to confirm if they support this functionality.
  
  You can bind a service to an application with the command `cf bind-service APPLICATION SERVICE_INSTANCE`.
  
  Alternately, you can configure the deployment manifest file by adding a `services` sub-block to the `applications` block and specifying the service instance. For more information and an example on service binding using a manifest, see the Sample App step.
  
  <%=vars.dev_console_5%>
  
  <p class="tip"><strong>Sample App Step</strong><br />You can skip this step. Open the <code>manifest.yml</code> file in a text editor to view the bound service instance information. Locate the file in the app root directory and search for the <code>services</code> sub-block in the <code>applications</code> block, as the example below shows.
  
  <pre class="code">
  ---
  