2
目的:设置弹性魔豆环境变量
我想从预部署部署挂钩
尝试设置部署时间戳作为环境变量:
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/00_set_deploy_time.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
export DEPLOY_TIME=`date +%s`
DEPLOY_TIME
dosen't get set。
最糟糕的情况我可以将部署时间写入随机文本文件。但是,由于我的应用程序将频繁地读取此变量,因此这不是最佳选择。
EBS ==弹性块存储,而不是弹性Beanstalk。 –
哎呦,我编辑了标题 –
你可以尝试追加变量到'/ etc/profile.d/eb_envvars.sh',其中EB变量的其余部分被设置。 – Brian