部署到Elastic Beanstalk—找不到目录


Deploying to Elastic Beanstalk - can't find directories

我正在将部署推到一个新的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答案说),但是我在磁盘上找不到它!我做错了什么?

问题是.config文件指定commands:

我应该使用container_commands (docs: 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