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.
To do so:
Create a Repository and Properties File on Github
- Procedure
- Create a repository on Github.
- 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 isDEV
, the properties file name must bePCFAPP-DEV.properties
. - 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 theemail
group and its value isxyz@abc.com
, define the property in the.properties
file as:email.username=xyz@abc.com
- The name of the property must match the name of the app property. For example, if the app property is named
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
- Bind the service instance of Spring Cloud Config Server to your Flogo app.
- Navigate to the setting of the pushed app.
- Under
User Provided Env Variables, add the following environment variable:
FLOGO_APP_PROPS_SPRING_CLOUD = {"profile":"<PROFILE_NAME>"}
- Restage the app and see the logs using the following command:
$ cf logs <APP_NAME_IN_PCF> --recent