Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 1.76 KB

File metadata and controls

34 lines (29 loc) · 1.76 KB

CF Setup

The following steps will help you prepare a cloud foundry application for the sample you are working on (application-properties, auto-reconfiguration, etc).

These instructions assume you have access to CF and OCP environments and are logged into each.

Provisioning a MySQL database

This demo attempts to simulate a situation where you are migrating a CF app that is bound to an external database. Often, this is done using User Provided Services. Both external and internal services appear the same to a CF app, and both are displayed when running cf services. So, for this demo, we will provision a MySQL database from the CF Marketplace. This will create an internal database, but since a CF app doesn't know the difference between internal or external, this will work for the demo.

Follow these steps to provision a MySQL database:

  1. Create the MySQL database
    cf create-service compose-for-mysql Standard testdb
  2. Confirm the database was created
    cf services

Deploying the CF Application

CF applications are configured in code using an App Manifest. The app manifest for this application is manifest.yml. One of the important fields in this file is services, which lists the service that we created, testdb.

In the tutorial folder you are working on (application-properties, auto-reconfiguration, etc), run the following commands to deploy your application:

  1. Build the code locally to produce a Jar
    mvn clean install
    
  2. Push your CF application
    cf push
    
  3. Confirm your application was deployed successfully
    cf apps