2017-05-08 64 views
1

任何分支我推我的代碼正在部署到FTP。在bitbucket上爲一個存儲庫創建多個管道?

image: samueldebruyn/debian-git 

pipelines: 
    default: 
    - step: 
     script: 
      - apt-get update 
      - apt-get -qq install git-ftp 
      - git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://ftp.example.com/path/to/website 

如何爲不同的分支創建多個管道?

測試分支測試/路徑,並部署分支部署/路徑

回答

1

如果我正確地理解它,你正在尋找觸發管線取決於你正在工作的分支。我一直在做這個如下:

image: maven:3.3.9-jdk-8 

pipelines: 
    default: # It define rules for all branches that don't have any specific pipeline assigned in 'branches'. 
    - step: 
     script: 
      - mvn -U clean test 
    branches: 
    master: # It runs only on commit to the master branch. 
     - step: 
      script: 
      - mvn -U clean test 
    feature/*: # It runs only on commit to branches with names that match the feature/* pattern. 
     - step: 
      script: 
      - mvn -U clean verify 
    live: # It runs only on commit to the live branch 
     - step: 
      image: python:2.7 
      script: 
      - chmod +x deploy.bash 
      - ./deploy.bash 

凡分支名是一個glob pattern。所以你會得到適當的自由來匹配正確的分支。

相關問題