【问题标题】:AWS CodeDeploy Appspec.yml files are not being copied to destinationAWS CodeDeploy Appspec.yml 文件未复制到目标
【发布时间】:2021-10-12 13:03:27
【问题描述】:

我的文件已正确复制到 EC2 实例以进行部署,但未复制到目标位置。我有这样的 appspec.yml 文件:

ubuntu@ip:~$ cat /opt/coded*/deployment-root/*/*/de*/appspec.yml
version: 0.0
os: linux
# I also tried with source: /
files:
  - source: .
    destination: /home/ubuntu/
file_exists_behavior: OVERWRITE
# notes

# ------------------------------------------------------------------------------------

# To learn more about hooks, visit the docs here:
# https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-server
hooks:
  BeforeInstall:
    - location: scripts/install_dependencies
      timeout: 300
      runas: root
  ApplicationStart:
    - location: scripts/start_server
      timeout: 300
      runas: root
  ApplicationStop:
    - location: scripts/stop_server
      timeout: 300
      runas: root

我也尝试将 source 设置为 source: / ,结果相同;没有任何内容被复制

我看到我的文件都在 /opt/coded* 等路径中。但为什么 CodeDeploy 代理不将我的文件复制到目标?下载包钩子很好,当我需要实际访问我的文件时,我得到的唯一错误是在 ApplicationStart 钩子中。

注意:我使用 GitHub 作为修订存储,而不是 S3,如果有帮助的话

编辑:在我的 install_dependencies 脚本中可能有用的信息,我运行的内容如下:

cd /home/ubuntu/
pip install -r requirements.txt

pip安装在哪里是找不到文件的那一行

【问题讨论】:

    标签: amazon-web-services aws-code-deploy aws-code-deploy-appspec


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-15
      • 1970-01-01
      • 2021-08-24
      • 1970-01-01
      • 2016-08-25
      • 1970-01-01
      • 2020-06-23
      • 2020-01-05
      相关资源
      最近更新 更多