【问题标题】:In AWS Codestar, how to configure branch deployments to specific environments?在 AWS Codestar 中,如何配置分支部署到特定环境?
【发布时间】:2018-03-05 05:24:39
【问题描述】:

我刚刚创建了一个全新的 AWS Codestar 项目。

据我所知,Codestar 只是一个集成多个 AWS 产品的仪表板。

有一件事我还不知道如何配置,那就是分支部署。

在我的 git 存储库中,我有 3 个分支:masterdevelopstaging

在理想情况下,master 部署到生产环境,develop 部署到开发环境,staging 部署到 QA 环境。

我不知道如何使用 AWS 配置此管道,也无法在他们的开发人员门户中找到相关文档。

这是我的buildspec.yml 文件,以防万一它可以在那里配置:

version: 0.2

phases:
  install:
    commands:
      - echo Installing NPM Packages...
      - npm install
  build:
    commands:
      - aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.yml

artifacts:
  type: zip
  files:
    - template-export.yml

这是一个使用 AWS API Gateway 将请求路由到 AWS Lambda 函数的项目(如果需要)。

【问题讨论】:

    标签: amazon-web-services aws-api-gateway amazon-cloudformation aws-codestar


    【解决方案1】:

    遗憾的是 AWS CodePipline 不支持传入 git 分支。去年他们只增加了对通过 git commit sha1 的支持(更多可以找到here)。

    我建议您遵循 CodePipline 文档 here,为每个分支创建 3 个管道(您甚至可以创建一个特殊的 buildspec_dev.yaml 或 buildspec_prod.yaml,查看更多示例 here)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-20
      • 1970-01-01
      • 1970-01-01
      • 2015-05-13
      • 1970-01-01
      • 2018-11-24
      • 1970-01-01
      相关资源
      最近更新 更多