我试图部署托管在S3上的构建存档,并在beforeInstall期间获得以下错误:
Script does not exist at specified location: /opt/codedeploy-agent/deployment-root/47208456650-458497-4028-97qa6-ef3a7sa30fa96f/d-0S472LBGI/deployment-archive/deployment/backup.sh
我的构建存档只包含源代码。构建脚本永久保存在我的服务器上。
AppSpec。Yml看起来像
version: 0.0
os: linux
files:
- source: /build.tgz
destination: /var/www/proj/deployment <- deployment scripts are here
hooks:
BeforeInstall:
- location: backup.sh
runas: root
timeout: 300
AfterInstall:
- location: deploy.sh
runas: root
timeout: 300
ApplicationStart:
- location: applicationStart.sh
runas: root
timeout: 300
我总是在包中包含部署脚本。尝试将位置设置为绝对值。如。/var/www/proj/deployment/backup.sh
source
指的是包中的一个文件/目录。包将被提取到以下位置:
/opt/codedeploy-agent/deployment-root/47208456650-458497-4028-97qa6-ef3a7sa30fa96f/d-0S472LBGI/deployment-archive/deployment
'destination'表示要复制文件/目录的位置。
可以指定多个文件。如:
files:
- source: Config/config.txt
destination: /webapps/Config
- source: source
destination: /webapps/myApp
以下是AppSpec文档:http://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref-structure.html