Google App Engine灵活 - 环境变量 [英] Google App Engine Flexible - environment variables
问题描述
如果我的circle-ci使用例如Google 'gcloud app deploy app.yaml'有没有简单的方法可以传递一个dev / prod变量,并在下面的app.yml文件中替换它?
if I have my circle-ci deplying to google with e.g. 'gcloud app deploy app.yaml' is there a simple way I can pass a dev / prod variable and have it replaced in my app.yml file below ?
当然,我可以有多个app.dev.yml,app.dev.yml文件等,但是有很多重复,除非我可以通过使用某种基本app.yml覆盖一些
Sure, I could have multiple app.dev.yml, app.dev.yml files etc but theres a lot of duplication involved unless I can just override some by using some sort of base app.yml
runtime: nodejs
env: flex
service: email
env_variables:
PUBSUB_TOPIC: dev-email-integration-email
PUBSUB_VERIFICATION_TOKEN: <your-verification-token>
推荐答案
可悲的是真的没有一个好方法可以做这个。我实际上建议使用app.yaml来实现此目的,而不是使用json文件和 nconf中。这就是我们在所有 nodejs samples 。
Sadly there really isn't a good way to do this. I'd actually suggest not using app.yaml for this purpose, and instead using a json file and nconf. That's how we do it in all of our nodejs samples.
希望这会有所帮助!
这篇关于Google App Engine灵活 - 环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!