3

I am trying to create an application in DevOps Services using Alchemy API services. Every time I try to build and deploy the application I need to set the Alchemy_Key in Bluemix Environment Variable. Is their any option to automate the creation of User-Defined Variable?

Amit Kumar Gupta
  • 17,184
  • 7
  • 46
  • 64
  • Environment variable settings should persist after a redeploy. Are you seeing the environment variable getting lost? – lmsurprenant Jun 16 '15 at 12:22

2 Answers2

3

You can automate the creation of a user defined environment variable by adding the following to the manifest.yml file :

env:
    ALCHEMY_KEY: ${value}

Please look at the following link for additional attributes to be used in manifest.yml for deploying applications : http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html

Thanks.

lmsurprenant
  • 1,723
  • 2
  • 14
  • 28
  • I would avoid setting keys and passwords in the manifest.yml because I prefer not to put those things in source control (hard to control their access). – lmsurprenant Jun 16 '15 at 12:21
  • To avoid exposing keys in manifest.yml, one way is to add a user defined service as explained in Niklas Heidloff's article : http://heidloff.net/nh/home.nsf/article.xsp?id=16.12.2014110019NHEDRA.htm – Sandhya Kapoor Jun 16 '15 at 14:24
1

You can also use the cf CLI command: cf set-env

cf help set-env NAME: set-env - Set an env variable for an app

ALIAS: se

USAGE: cf set-env APP_NAME ENV_VAR_NAME ENV_VAR_VALUE

mmallett
  • 11
  • 3