Is it possible? Here is my app.yaml
:
runtime: nodejs8
env_variables:
NODE_ENV: production
PORT: 8080
API_KEY: ${API_KEY}
${API_KEY}
is like a placeholder.
When I run API_KEY=xdfj212c gcloud app deploy app.yaml
command, I want to pass API_KEY=xdfj212c
to app.yaml
and replace the placeholder with
xdfj212c
.
Expect result:
runtime: nodejs8
env_variables:
NODE_ENV: production
PORT: 8080
API_KEY: xdfj212c
Or, After I run
export API_KEY=xdfj212c
gcloud app deploy
I want the same behavior.
Is this make sense for google app engine deployment workflow?
You could always use 'sed':
The 'bad' thing is that this stores the key back, but you can always append a new 'sed' command to replace the key again with the placeholder, or use your VCS mechanism to just reset the change the file.
Another option is saving your 'app.yaml' file as something like 'app_template.yaml' and do this for your deployments:
This will do the replacement in a new file, 'app.yaml', and then do the deployment.