All notes
Cloudfoundry

Quick Start

Good examples


cf api appURL
cf login

cf target -o orgName
cf push

cf set-env projName envKey envValue
cf restage projName

FAQ

Set environment variables



# https://github.com/cloudfoundry/cli/issues/417
cf curl -X PUT /v2/apps/<app-guid> -d '{"environment_json":{"ENV1":"VAL1", "ENV2": "VAL2"}}'

Also as mentioned by dkoper:

...running cf commands in parallel (like with &) could lead to unpredictable issues: when the access token expires, that command process will retrieve a new token from UAA and save it to your local config.json: any command running in parallel, depending on timing, could be reading from an incomplete file as it is being written to.

You can set env in manifest.yml

SO: set env var on cloudfoundry.


---
applications:
- name: app1
  env:
    ENV_VAR_1: MYVALUE
    ENV_VAR_2: ZZZ