【发布时间】:2013-08-16 04:02:14
【问题描述】:
这是我的EB配置文件.ebextensions/app.config的摘录:
option_settings:
- option_name: AWS_SECRET_KEY
value: xxxxxxxxxx
- option_name: AWS_ACCESS_KEY_ID
value: xxxxxxxxxx
- option_name: APP_ENV
value: development
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: ProxyServer
value: nginx
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: GzipCompression
value: true
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: NodeVersion
value: 0.8.10
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: NodeCommand
value: npm start
commands:
test_command:
command: echo $APPLICATION_ENV > /home/ec2-user/test.txt
cwd: /home/ec2-user
ignoreErrors: true
然后我做正常的事情:
$ git commit -am "wrote config file"
$ eb init
...
$ eb start
...
would you like to use the most recent commit [y/n]
$ y
然后在部署完成并处于绿色状态后,查看我发现的eb 生成的.elasticbeansalk/optionsettings.myapp-env 文件:
[aws:elasticbeanstalk:application:environment]
PARAM1=
PARAM2=
PARAM3=
PARAM4=
PARAM5=
[aws:elasticbeanstalk:container:nodejs]
GzipCompression=false
NodeCommand=
NodeVersion=0.8.24
ProxyServer=nginx
我的环境变量未设置,NodeCommand 指令未设置,NodeVersion 已被忽略。什么给了,EB?它怎么能忽略某些指令而不是其他指令?关于我做错了什么有什么想法吗?
编辑
根据this post,保存环境变量的JSON保存在这里:
/opt/elasticbeanstalk/deploy/configuration/containerconfiguration
这意味着我可以解析这个字段的变量,但这很令人沮丧,因为它应该由配置文件处理(否则为什么要有一个?)。我的配置文件肯定还是有问题,否则EB在这方面似乎完全崩溃了……
【问题讨论】:
-
我也遇到了同样的问题 :( 你找到解决方案了吗?
标签: node.js amazon-web-services amazon-elastic-beanstalk