CircleCI - 特定于分支的部署不会触发部署

时间:2017-05-02 03:54:05

标签: git google-app-engine circleci

我试图通过我的存储库中的单独分支来实现单独的部署目标,并且我想使用circle.yml文件来使用分支过滤功能。这是我的circle.yml文件:

machine:
  environment:
    # Replace this with your project ID
    GCLOUD_PROJECT: "team4tress-165000"

    GCLOUD_PROJECT_DEV: "team4tress-dev"

dependencies:
  pre:
    - sudo chown -R $USER /home/ubuntu/.config
    # Download App Engine SDK
    # This is not necessary to deploy, its only necessary  to run local tests importing the App Engine SDK
    - curl -o $HOME/google_appengine_1.9.30.zip https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.30.zip
    - unzip -q -d $HOME $HOME/google_appengine_1.9.30.zip
    # Make sure gcloud is up to date
    - gcloud --quiet components update app
    - echo "y" | sudo /opt/google-cloud-sdk/bin/gcloud components update --version 146.0.0

test:
  override:

deployment:
  staging:
    branch: master
    commands:
      # Replace <your-project-id>
      - gcloud config set project $GCLOUD_PROJECT

      - sudo chown -R $USER /home/ubuntu/.config
      - echo $GCLOUD_SERVICE_KEY | base64 --decode --ignore-garbage > ${HOME}/gcloud-service-key.json
      - sudo /opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
      - sudo /opt/google-cloud-sdk/bin/gcloud config set project $GCLOUD_PROJECT


      # deploy to AppEngine
      - sudo chown -R $USER /home/ubuntu/.config/gcloud/credentials
      - gcloud -q app deploy app.yaml --promote

    development:
      branch: dev
      commands:

        # Replace <your-project-id>
        - gcloud config set project $GCLOUD_PROJECT_DEV

        - sudo chown -R $USER /home/ubuntu/.config
        - echo $GCLOUD_SERVICE_KEY_DEV | base64 --decode --ignore-garbage > ${HOME}/gcloud-service-key.json
        - sudo /opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
        - sudo /opt/google-cloud-sdk/bin/gcloud config set project $GCLOUD_PROJECT_DEV


        # deploy to AppEngine
        - sudo chown -R $USER /home/ubuntu/.config/gcloud/credentials
        - gcloud -q app deploy app.yaml --promote

我的问题是,当我将更改推送到“dev”分支时,圆形构建会运行,但会在“部署”部分之前停止。当我推送master时,它按预期运行部署部分,但是当我推送dev时,我似乎无法触发“dev”部署部分。

这是我的分支结构:

MacBook-Pro-2:fourtress alex$ git branch
  dev
* master
  staging

部署部分未运行的任何想法?

0 个答案:

没有答案