[英]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.