2017-05-08 5 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이다. 따라서 올바른 지점에 맞는 적절한 자유를 얻을 수 있습니다.