【发布时间】:2019-05-30 20:24:20
【问题描述】:
我的应用程序有一个流程,我有一个名为 Staging 的实例,另一个是 QA,然后有一个 Production 实例。我们从 Staging 创建分支并在验证后将它们合并到 staging 中,然后合并到 QA 中,然后在完全验证后合并到 master 中。 我是管道新手,我想实现以下流程
- 如果推送了某个分支,则应仅在 Staging EC2 实例上进行部署,并且应切换该分支
- 如果某个分支合并到 staging 中,则部署应该只在 Staging 上进行
- 如果随后将暂存合并到 QA 中,则应仅在 QA 上进行部署
- 如果某些东西被合并到 master 中,部署应该只在生产上进行
我正在将 Bitbucket 与 AWS CodeDeploy 服务一起使用,并且存储库托管在 Bitbucket 上 目前我能够在 1 个实例上部署主分支。我怎样才能做到这一点? 我的 appspec.yml 如下
image: php:7.2.13
pipelines:
branches:
master:
- step:
caches:
- composer
script:
- sh bitbucket-pipelines-common.sh
- vendor/bin/phpunit
- sh bitbucket-pipelines-codedeploy.sh
develop:
- step:
caches:
- composer
script:
- sh bitbucket-pipelines-common.sh
- vendor/bin/phpunit
custom:
just-test-without-cache:
- step:
script:
- sh bitbucket-pipelines-common.sh
- vendor/bin/phpunit
【问题讨论】:
标签: git amazon-ec2 aws-code-deploy bitbucket-pipelines