Deploying a Flogo App to Pivotal Application Service
After installing the Cloud Foundry Command Line Interface (cf CLI), you can push a Flogo app to the Pivotal Application Service. For more information on Pivotal Cloud Foundry, Pivotal Application Service and its CLI, refer to the Pivotal Cloud Foundry documentation.
Before you begin
- Execute the following command to ensure that the Cloud Foundry command line client is installed successfully:
$ cf version
This command returns information about the currently installed version of the Cloud Foundry command line client. For example:
cf version 6.42.0+0cba12168.2019-01-10
- Execute the following command to authenticate yourself in Pivotal Cloud Foundry:
$ cf login
Building a Linux Binary
From the Web UI
To build a Linux binary from the Web UI:
- From the
Flogo Enterprise Web UI, build a Linux binary using the
Linux/amd64option. See Building the App section for details. - Provide execute permission to the app binary:
chmod +x <app-binary> - Follow the steps in the appropriate section below.
From the CLI
To build a Linux binary from the CLI:
- Export your app as a JSON file (for example,
flogo-rest.json) by clicking the Export app button on the flow details page. - Build a Linux binary for the app from the CLI. Open a command prompt and change directory to
<FLOGO_HOME>/<version>/binand run:builder-<platform>_<arch> build -p linux/amd64 -f <path-to-the-.json-file>
This generates a linux app binary.
- Provide execute permission to the app binary:
chmod +x <app-binary> - Follow the steps in the appropriate section below.
Without Using a manifest.yml File
- Procedure
- Create a temporary folder.
- Copy the
linux/amd64binary of the app which you had created in Building a Linux Binary and save it to the temporary folder created in step 1.Note:- Ensure that you do not save the binary to a path which already contains other files and directories.
- In your Flogo app, for a REST trigger, ensure that port is set to 8080 in the trigger configuration.
- In a command window, navigate to the path where you saved the binary and execute the following command:
$ cf push <NAME_IN_PCF> -c './<APP_BINARY_NAME>' -b binary_buildpack -u none
For example:
cf push test1 -c ./Timer-linux_amd64 -b binary_buildpack -u none
For the
-uargument, depending upon the health check, provide value asnone,port,http, orprocess. For example, if the app is a REST API exposing an HTTP endpoint, useportafter-u.Note: In your Flogo app, for a REST trigger, ensure that port is set to 8080 in the trigger configuration. - After successfully deploying the app to the Pivotal Application Service, you can check the log of the app using the following command:
$ cf logs <APP_NAME_IN_PCF> --recent
Using a manifest.yml File
- Procedure
- Create a temporary folder.
- Copy the
linux/amd64binary of the app which you had created in Building a Linux Binary and save it to the temporary folder created in step 1.Note: In your Flogo app, for a REST trigger, ensure that the port is set to 8080 in the trigger configuration.You have two options:
- If you do not mention Path in the
manifest.ymlfile, you must have bothmanifest.ymland the app binary in the same directory. - If you have the
manifest.yamlfile and the app binary in different directories, you must mention the following in themanifest.ymlfile:path: <app binary path>
- If you do not mention Path in the
- Create a manifest file in YAML. The following manifest file illustrates some YAML conventions:
# this manifest deploys REST APP to Pivotal Cloud Foundry applications: - name: REST_APP memory: 100M instances: 1 buildpack: binary_buildpack command: ./REST-linux_amd64 disk_quota: 100M health-check-type: port
Note:REST-linux_amd64indicates the name of app binary. - Save the
manifest.ymlfile and execute the following command in the same directory:$ cf push
Result The Flogo app is successfully pushed to Pivotal Cloud Foundry.
Subtopics