4

很久以前我已经这样做了,但现在它不起作用...... :)

我正在尝试在 ElasticBeanstalk 应用程序中使用 EBExtensions。我创建了一个普通的 Elastic Beanstalk 环境,没有超出默认配置的配置。我给了它一个具有如下目录结构的应用程序版本:

.ebextensions
  40testextension.config
app.js
other files

重要的部分是我的可部署工件的根目录中有一个名为 .ebextensions 的文件夹,我认为它应该位于该位置。

该文件内的 40testextension.config 文件具有以下内容:

files:
  "/home/ec2-user/myfile" :
    mode: "000755"
    owner: root
    group: root
    content: |
      # This is my file
      # with content

我在创建环境的时候上传了那个版本,环境创建成功。但是当我查找该文件时,它不存在。此外,当在 /var/log 的日志中为该 ebextension 文件名执行递归 grep 时,我只得到一个结果:

./eb-activity.log:    inflating: /tmp/deployment/application/.ebextensions/40testextension.config

查看日志后,当工件被下拉到主机时,文件似乎存在,但 ebextension 从未给出任何正在运行的指示。

我在这里想念什么?我在遥远的过去做过这件事,并且工作得非常好,但是这次我似乎无法让 Beanstalk 部署生命周期执行该事情。

4

1 回答 1

0

尝试运行它以-x Print commands and their arguments as they are executed进行调试并尝试将模式更改为000777.

files:
  "/home/ec2-user/myfile" :
    mode: "000777"
    owner: root
    group: root
    content: |
      #!/usr/bin/env bash

      set -xe
于 2017-04-30T01:13:40.197 回答