Elastic Beanstalk 和 Symfony bin/console 命令
Posted
技术标签:
【中文标题】Elastic Beanstalk 和 Symfony bin/console 命令【英文标题】:Elastic Beanstalk and Symfony bin/console commands 【发布时间】:2018-12-24 19:17:55 【问题描述】:我在部署后尝试运行命令doctrine:schema:update
。于是我在.ebextensions
下准备了这个文件
83_post_setup.config
container_commands:
01_update_symfony_db:
command: php /var/app/current/bin/console doctrine:schema:update --force
但我不断收到以下错误:
ERROR: [Instance: i-0ffc989ebd7c41d79] Command failed on instance. Return code: 1 Output: Could not open input file: /var/app/current/bin/console.
container_command 01_update_symfony_db in .ebextensions/83_post_setup.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1]
我也尝试用commands:
替换container_commands:
,但后来我遇到了ENV 问题ENV RDS_USERNAME not found
,因为运行此命令还为时过早。有人有解决方案吗?
【问题讨论】:
【参考方案1】:只需去掉完整路径即可解决:
01_update_symfony_db:
command: php bin/console doctrine:schema:update --force
【讨论】:
以上是关于Elastic Beanstalk 和 Symfony bin/console 命令的主要内容,如果未能解决你的问题,请参考以下文章
Elastic Beanstalk、Docker 和持续集成
Amazon Elastic BeanStalk 错误:无法创建 AWS Elastic Beanstalk 应用程序版本
Cloudformation 协助 Elastic Beanstalk 和 Application Load Balancer