代码部署挂钩shell脚本-在哪里打包?

时间:2019-03-25 19:53:45

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

我可以将要使用的shell脚本放在要部署到实例的程序包中吗?

我在我的工件(appspec.yml所在的根)的根目录上创建了目录“ aws / scripts”,并将想要的shell脚本放在该目录中的钩子中。该工件已压缩并放在我的S3文件夹(我要部署的程序包)中。我的appspec.yml中的钩子可以使用程序包中的这些文件,还是必须将它们放在EC2实例上才能在CodeDeploy期间使用?

我以这种方式设置它,似乎无法访问那些文件。 Codebuild看到了appspec.yml,所以我知道部署开始了。 另外,有什么方法可以使用appspec文件中的命令,还是只能告诉它运行shell脚本?

我有以下appspec.yml文件

os: linux
files:
- source: /WebContent
destination: /usr/local/tomcat/webapps/ROOT
- source: /build
destination: /mnt/efs/build
- source: /properties_files
destination: /mnt/efs/tmp
- source: /aws
destination: /aws
hooks:
ApplicationStop:
- location: /tmp/application_stop.sh
runas: root
BeforeInstall:
- location: /tmp/before_install.sh
runas: root
AfterInstall:
- location: /tmp/after_install.sh
runas: root
ApplicationStart:
- location: /tmp/application_start.sh```

0 个答案:

没有答案