funkybro
funkybro

Reputation: 8671

Jenkins declarative pipeline upon Bitbucket pull request

I am building a declarative pipeline Jenkinsfile for semantic branching. It has the format:

pipeline {
  stages {
    stage('develop branch build') {
      when {
        branch 'develop'
      }

      // build and deploy to QA environment
    }

    stage('release branch build') {
      when {
        branch 'release'
      }

      // build and deploy to live/preproduction environment
    }
  }
}

I would like an additional stage to run upon a Bitbucket pull request. It would do a particular PR test and deploy task, and pass or fail the pipeline accordingly.

How might I enhance this script to do that?

Upvotes: 0

Views: 622

Answers (1)

Holleoman
Holleoman

Reputation: 269

I use the generic webhook plugin. This work pretty nice with bitbucket.

Upvotes: 1

Related Questions