2017-12-01 16 views
1

bitbucket-pipelines.yml 파일을 설정하여 Heroku에 자동으로 배포하도록 bitbucket을 설정했습니다. 해당 파일의 코드는 다음과 같습니다. 모든 것이 훌륭하게 작동합니다. 배포 할 때마다, Heroku가 그것을 선택하고 성공적으로 빌드합니다. 그러나, 그것은 두 지점에서 일어나고 있습니다. 마스터 분기 커밋 후에 만 ​​빌드하는 것을 선호합니다. 나는 이것이 가능하다고 생각하지만, 내가 찾은 해결책은 효과가없는 것으로 보인다.개발을 추진할 때 BitBucket이 heroku에 배포하지 못하도록

의 bitbucket-pipelines.yml 파일 : 나는 시도했다

image: node:6.9.4 

    pipelines: 
    default: 
     - step: 
      caches: 
      - node 
      script: 
      - npm install 
      - git push https://heroku:[email protected]/$HEROKU_APP_NAME.git HEAD 

솔루션 :는 '

  • 추가 (I 연구에 계속 업데이트됩니다) : 심판/헤드/bitbucket.pipelines.yml의 마지막 줄에 'HEAD'뒤에있는 'master'뒤에 있습니다.

EDIT : VonC의 제안에 따라 bitbucket-pipelines.yml 파일을 아래 코드로 변경했습니다. 도움을 주셔서 대단히 감사합니다.

image: node:6.9.4 

    pipelines: 
    branches: 
     master: 
     - step: 
      caches: 
       - node 
      script: 
       - npm install 
       - git push https://heroku:[email protected]/$HEROKU_APP_NAME.git HEAD 

답변

1

이 있어야는 "Branch workflows"는 설명 무엇 :

image: node:5.11.0 
pipelines: 
    default: 
    - step: 
     script: 
      - echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'." 
    branches: 
    master: 
     - step: 
      script: 
      - echo "This script runs only on commit to the master branch." 
    feature/*: 
     - step: 
      image: java:openjdk-9 # This step uses its own image 
      script: 
      - echo "This script runs only on commit to branches with names that match the feature/* pattern."