简体   繁体   English

AWS CodeDeploy 说脚本丢失,即使它存在

[英]AWS CodeDeploy says script missing even though it exists

I am trying to deploy an application onto EC2 instances with AWS CodeDeploy.我正在尝试使用 AWS CodeDeploy 将应用程序部署到 EC2 实例上。 I am getting up to the point where CodeDeploy errors out at the BeforeInstall hook.我已经到了 CodeDeploy 在BeforeInstall挂钩处出错的地步。 The error message I am getting is related to a ScriptMissing .我收到的错误消息与ScriptMissing相关。 The exact error is:确切的错误是:

Script does not exist at specified location: /opt/codedeploy-agent/deployment-root/1bfe51a8-151a-4366-8a3f-c061adb4bb90/d-X8N0B5IOE/deployment-archive/scripts\codedeploy\install_dependencies.sh

The odd thing is the file exists in my version control repository.奇怪的是该文件存在于我的版本控制存储库中。 So far I have tried changing the permissions of the script, and have also tried different method in the appspec.yml file in order to get CodeDeploy to recognize this file.到目前为止,我已尝试更改脚本的权限,并且还在 appspec.yml 文件中尝试了不同的方法以使 CodeDeploy 识别此文件。 All methods have failed.所有的方法都失败了。 I tried the other solutions posted relating to this scenario but they do not seem to help me.我尝试了与此场景相关的其他解决方案,但它们似乎对我没有帮助。

Do these script files int he appspec.yml also need to part of the zip file that CodeDeploy uses? appspec.yml 中的这些脚本文件是否也需要成为 CodeDeploy 使用的 zip 文件的一部分? Any advice would be appreciated.任何意见,将不胜感激。 Below is the appspec.yml file.下面是 appspec.yml 文件。

Appspec应用规格

version: 0.0
os: linux
files:
  - source: /
    destination: /var/www/html
    overwrite: true

hooks:
  BeforeInstall:
    - location: scripts/codedeploy/install_dependencies.sh
      timeout: 300
      runas: root
  AfterInstall:
    - location: scripts/codedeploy/install_composer_dependencies.sh
      timeout: 300
      runas: root
    - location: scripts/codedeploy/start_server.sh
      timeout: 30
      runas: root
  ApplicationStop:
    - location: scripts/codedeploy/stop_server.sh
      timeout: 30
      runas: root

I had a similar problem.我有一个类似的问题。 My paths was scripts/file-name.sh .我的路径是scripts/file-name.sh I just removed 'scripts/' from location path and leave only.sh file names and it works for me.我刚刚从位置路径中删除了“scripts/”并只留下 .sh 文件名,它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS Glue 中的简单 ETL 作业显示“文件已存在” - Simple ETL job in AWS Glue says "File Already Exists" CodeDeploy 应用程序缺少 Composer 环境变量 - Composer Environment variable missing on CodeDeploy Application 即使有 0 个连接,Aws MySQL serverless v2 也不会缩小到 0.5 ACU - Aws MySQL serverless v2 will not scale down to 0.5 ACU even though 0 connections 如何获取 AWS CodeDeploy 日志并在 BitBucket 管道中显示它们 - How to fetch AWS CodeDeploy logs and show them in a BitBucket pipeline AWS CodeDeploy 代理在安装过程中删除错误文件夹中的文件 - AWS CodeDeploy agent is deleting files in the wrong folder during install 为什么我的 AWS SQS 消息即使不符合筛选条件也会被删除? - Why are my AWS SQS messages being deleted even though they don't match the filter criteria? .NET 二进制文件缺少 AWS Lambda - .NET Binaries Missing AWS Lambda 缺少 AWS Beanstalk Amazon Linux 2 平台挂钩 - Missing AWS Beanstalk Amazon Linux 2 Platform Hooks AWS SQS 中缺少 s3 事件 - Missing s3 events in AWS SQS 谷歌云 function 在测试期间崩溃,即使部署很好 - Google cloud function crashes during testing even though the deployment is fine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM