Child pages
  • Bitbucket Push And Pull Request Plugin

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagegroovy
themeEclipse
titlePipeline script
properties([
    pipelineTriggers([
        [
            $class: 'BitBucketPPRTrigger',
            triggers : [
                [
                    $class: 'BitBucketPPRPullRequestTriggerFilter',
                    actionFilter: [
                        $class: 'BitBucketPPRPullRequestCreatedActionFilter'
                    ]
                ]
            ]
        ]
    ])
])
node {
	def sourceBranch = ""
        def targetBranch = ""
        try{
            sourceBranch = "${BITBUCKET_SOURCE_BRANCH}";
            targetBranch = "${BITBUCKET_TARGET_BRANCH}";
        }catch(e){}

        if(sourceBranch == ""){
            sourceBranch = 'development'
        }

        if(targetBranch == ""){
            targetBranch = 'master'
        }

        checkout changelog: true, poll: true, scm: [
            $class: 'GitSCM',
            branches: [
                [name: '*/'+sourceBranch]
            ],
            doGenerateSubmoduleConfigurations: false,
            extensions: [
                 [
                    $class: 'PreBuildMerge',
                    options: [
                        fastForwardMode: 'FF',
                        mergeRemote: 'origin',
                        mergeStrategy: 'recursive',
                        mergeTarget: ''+targetBranch
                    ]
                ]
            ],
            submoduleCfg: [],
            userRemoteConfigs: [
                [
                    url: 'https://[user]@bitbucket.org/[org]/[repo].git']
                ]
            ]


        echo 'Some build steps'

}


Change Log

2.2.0 (2019-10-14)

Full Changelog

Implemented enhancements:

  • Added checkbox to define if changes on the repos have to be confirmed through the git plugin before starting a job triggered by a push
  • Added pull request support for Mercurial on Bitbucket Cloud

Merged pull requests:

  • #60 change pull request #59 and reformatting by cdelmonte-zg
  • #59 adding logic to trigger target branch on merge by raghav-a
  • #58 an option for repository hasChange() conditional behaviour by cdelmonte-z
  • #55 workflows: implement isPipelineMultibranch check by macghriogair
  • #51 Job DSL multiple triggers by rhotau
  • #50 Support for multiple triggers from dsl by rhotau

2.0.0 (2019-06-25)

Full Changelog

...