Bitbucket管道:步骤部署环境

时间:2019-09-13 18:37:11

标签: amazon-web-services docker yaml bitbucket bitbucket-pipelines

我正在配置以下脚本, 如何根据分支机构更改部署?

我希望feature / ci-cd分支和sandbox- *标签部署在沙盒部署环境中,而prod- *标签部署在生产部署环境中。

如何在不使用2个&release指针的情况下实现这一目标? (由于deployment: sandbox字符串)

image: python:3.6
options:
  docker: true

release-step: &release
  - step:
      deployment: sandbox
      services:
        - docker
      caches:
        - docker
        - pip
      name: Build Docker Image
      script:
        - pip3 install docker-compose awscli
        - docker-compose -v
        - command -v docker-compose
        - $(aws ecr get-login --no-include-email)
        - docker-compose build
        - docker-compose push
        - aws ecs update-service --cluster ${AWS_ECS_CLUSTER} --service ${AWS_ECS_SERVICE} --force-new-deployment

pipelines:
  branches:
    feature/ci-cd:
      - <<: *release
  tags:
    sandbox-*:
      - <<: *release
    prod-*:
      - <<: *release
    preprod-*:
      - step:
          image: node:9
          name: "push-to-preprod"
          script:
            - git subtree push [code]

0 个答案:

没有答案