部署到Elastic Beanstalk - 找不到目录

时间:2014-06-20 04:52:36

标签: php git amazon-web-services elastic-beanstalk

我正在推动部署到新的Beanstalk应用程序并尝试使用.config文件运行命令:

// .ebextensions/composer.config
commands:                                                                       
  01wtf:                                                                        
    command: cd /var/app && ls
  02wtf:                                                                        
    command: cd /var/app/current && ls

01wtf返回

.
..
/current
/support

02wtf返回

.
..

我正在尝试在/var/app/ondeck上运行命令(就像所有博文和SO答案所说的那样),但我在磁盘上找不到它!我做错了什么?

1 个答案:

答案 0 :(得分:2)

问题在于.config文件指定commands:

我应该使用container_commands(文档:http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands

我的命令在部署阶段之前运行;所以,ondeck尚未创建,并且(在全新的ec2实例的情况下)current为空。

// .ebextensions/composer.config
container_commands:                                                                       
  01wtf:                                                                        
    command: cd /var/app && ls
  02wtf:                                                                        
    command: cd /var/app/current && ls