cf-resource
cf-resource copied to clipboard
Environment variables defined in Manifest cannot be override
It is good practice to set default values for environment variables in the Manifest and only deploy time override those which require change.
While new variables are added to the deployment, the Manifest (default) values remain the same.
See pipeline snippet
used where I set a new variable (version) and try to override the eureka client to false.
- name: my-app
public: false
serial: true
plan:
- get: my-app-deployment
- get: my-app-release
- put: cf-deploy
params:
manifest: my-app-deployment/cloudfoundry/manifest.yml
path: my-app-release/my-component-((my-version)).jar
current_app_name: my-app
environment_variables:
version: ((my-version)
eureka.client.enabled: 'false'
manifest.yml
---
applications:
- name: my-app
instances: 1
buildpack: https://github.com/cloudfoundry/java-buildpack#v4.2
path: ./my-app.jar
memory: 1024M
disk_quota: 256M
stack: cflinuxfs2
no-route: true
env:
eureka.client.enabled: true
Now, when I inspect the app env after deployment...
$ cf env my-app
<...>
User-Provided:
eureka.client.enabled: true
version: 0.0.3
Hey!
If we can't override values in the manifest or add env variables in our pipelines then this is useless, the entire artifact. When are you planning to work on this? We tried environment_variables, vars, and vars_files and none of them worked at all.
Please, at least give us some feedback.
Regards,
Juan