5

To any branch I push my code is being deployed to FTP.

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

How to create multiple pipelines for different branches?

Like testing branch to testing/path, and deploy branch to deploy/path.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Elyor
  • 5,396
  • 8
  • 48
  • 76

1 Answers1

4

If I understood it correctly you are looking to trigger pipeline depending on the branch you are working on. I have been doing this as follow:

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

Where the branch name is a glob pattern. So you will get decent freedom in matching the right branch.

Qasim Sarfraz
  • 5,822
  • 2
  • 20
  • 26