Using Spring Cloud Configuration to Override App Properties

You can use Spring Cloud Configuration to override the properties of Flogo apps running on Pivotal Cloud Foundry.

Create a Repository and Properties File on Github

    Procedure
  1. Create a repository on Github.
  2. In the repository created in step 1 above, create properties file with the following file naming convention:
    <APP_NAME>-<PROFILE>.properties

    For example, if a Flogo app name is PCFAPP and the profile name is DEV, the properties file name must be PCFAPP-DEV.properties.

  3. Populate the <APP_NAME>-<PROFILE>.properties file with the key-value pairs for the overridden app properties.
    Note:
    • The name of the property must match the name of the app property. For example, if the app property is named Message, define the property in the properties file as:
      Message="<value>"
    • If the properties are in a group, define the property as:

      <groupname>.<propertyname> = <value>

      For example, if a property, username, is under the email group and its value is xyz@abc.com, define the property in the .properties file as:

      email.username=xyz@abc.com

Setup Spring Cloud Configuration on Pivotal Cloud Foundry

Set up an instance of Config Server for Pivotal Cloud Foundry with the Git repository created above using Spring Cloud Services on Pivotal Cloud Foundry. Refer to Spring Cloud Services for PCF documentation for detailed instructions.

Using Spring Cloud Configuration Service with Flogo

    Procedure
  1. Bind the service instance of Spring Cloud Config Server to your Flogo app.
  2. Navigate to the setting of the pushed app.
  3. Under User Provided Env Variables, add the following environment variable:
    FLOGO_APP_PROPS_SPRING_CLOUD = {"profile":"<PROFILE_NAME>"}
  4. Restage the app and see the logs using the following command:
    $ cf logs <APP_NAME_IN_PCF> --recent