2017-05-08 6 views
1

どのブランチにも私のコードはFTPにデプロイされています。bitbucket上の1つのリポジトリに対して複数のパイプラインを作成しますか?

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です。そうすれば、適切なブランチにマッチすることでまともな自由を得ることができます。

関連する問題