Is there a convention or place in the deploy manifest to specify environment variables for machines? Or would I have to write a shell script to do this? If I have to do that, do I have to set them in a pre-job hook?
Is there a convention or place in the deploy manifest to specify environment variables for machines? Or would I have to write a shell script to do this? If I have to do that, do I have to set them in a pre-job hook?
When creating a release, the convention is to set and export only those environment variables that your particular job/process needs and to do so in the job's control script.
For example, the bosh release exports several environment variables like
GEM_HOMEandhttp_proxyin the control/shell script which starts the director process (ref). TheGEM_HOMEstatically points to its own package directory, and thehttp_proxyis conditionally set based on operator-configured properties from the deployment manifest.The
pre-starthook is executed in its own process, so any environment variables that yourpre-startscript tries to export will not be propagated to other shell scripts that are later executed by bosh or monit.