我如何在多个代码部署阶段使用appspec.yml(每个阶段是一个不同的帐户)

时间:2019-07-10 09:15:00

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

  1. 我正在使用terraform在交叉帐户(AWS)上创建代码管道,并且运行良好。
  2. 我有4个阶段(源>构建> DeploySandbox> DeployTest
  3. 我在下面粘贴了一个appspec.yml,直到DeploySanbox管道变为绿色,但我不了解如何进行DeployTest。

  4. 对于DeployTest,有appgrp,depgrp,ec2 codedeploy代理,并且工件已成功下架并在安装步骤之前到达。

我想要一个shell脚本,该脚本将获取环境并在下一阶段(DeployTest)开始时通过

我收到的

错误是它无法初始化红外线模块。这是因为在shell脚本中传递了env值。`scripts/ tfinit.sh

我想要一个shell脚本,该脚本将获取环境并在下一阶段(DeployTest)开始时通过

我收到的

错误是它无法初始化红外线模块。这是因为在shell脚本中传递了env值。`scripts/ tfinit.sh

version: 0.0  
os: linux 
files:
   - source: scripts/tfinstall.sh
     destination: /opt/aws/tfinstall.sh
   - source: scripts/tfvalidate.sh
     destination: /opt/aws/tfvalidate.sh
   - source: scripts/tfplan.sh
     destination: /opt/aws/tfplan.sh 
   - source: scripts/tfapply.sh
     destination: /opt/aws/tfapply.sh
   - source: scripts/tfinit.sh
     destination: /opt/aws/tfinit.sh  
hooks:
   BeforeInstall:
     - location: scripts/tfinstall.sh
       timeout: 360
       runas: root
     - location: scripts/tfinit.sh
       timeout: 360
       runas: root    
   AfterInstall:
     - location: scripts/tfvalidate.sh
       timeout: 360
       runas: root
     - location: scripts/tfplan.sh
       timeout: 360 
       runas: root
     - location: scripts/tfapply.sh
       timeout: 360
       runas: root`

0 个答案:

没有答案