Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-26488

Add support for Bitbucket Pull Request Builder plugin

    XMLWordPrintable

Details

    Description

      Bitbucket PR Builder plugin is similar to GitHub PR Builder plugin.

      And Job DSL plugin already supports GitHub.

      This is feature request to support Bitbucket PR Builder.
      I have attached config.xml for a job using it.

      Per my understanding, the important sections of that XML are

      SCM configuration

       
      <scm class="hudson.plugins.git.GitSCM" plugin="git@2.3.4">
          <configVersion>2</configVersion>
          <userRemoteConfigs>
            <hudson.plugins.git.UserRemoteConfig>
              <url>git@bitbucket.org:${repositoryOwner}/${repositoryName}.git</url>
            </hudson.plugins.git.UserRemoteConfig>
          </userRemoteConfigs>
          <branches>
            <hudson.plugins.git.BranchSpec>
              <name>*/${sourceBranch}</name>
            </hudson.plugins.git.BranchSpec>
          </branches>
          <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
          <submoduleCfg class="list"/>
          <extensions>
            <hudson.plugins.git.extensions.impl.PreBuildMerge>
              <options>
                <mergeRemote>origin</mergeRemote>
                <mergeTarget>${targetBranch}</mergeTarget>
                <mergeStrategy>default</mergeStrategy>
              </options>
            </hudson.plugins.git.extensions.impl.PreBuildMerge>
          </extensions>
        </scm>
      

      Build trigger

       
      <triggers>
          <bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildTrigger plugin="bitbucket-pullrequest-builder@1.4.3-SNAPSHOT">
            <spec>H/1 * * * *</spec>
            <cron>H/1 * * * *</cron>
            <username>mycompany</username>
            <password>mypassword</password>
            <repositoryOwner>myteam</repositoryOwner>
            <repositoryName>myrepo</repositoryName>
            <ciSkipPhrases></ciSkipPhrases>
            <checkDestinationCommit>true</checkDestinationCommit>
          </bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildTrigger>
        </triggers>
      

      This is a follow up to question on Google Group

      Attachments

        Issue Links

          Activity

            mgrebenets Maksym Grebenets added a comment - Opened PR https://github.com/jenkinsci/job-dsl-plugin/pull/357

            I'm not going to add DSL support where the password can be stored in plain text in the DSL script. JENKINS-24707 must be fixed before adding DSL support.

            daspilker Daniel Spilker added a comment - I'm not going to add DSL support where the password can be stored in plain text in the DSL script. JENKINS-24707 must be fixed before adding DSL support.

            Added a label for bitbucket-pullrequest-builder-plugin because the DSL can also be added to that plugin through the Job DSL extension point.

            daspilker Daniel Spilker added a comment - Added a label for bitbucket-pullrequest-builder-plugin because the DSL can also be added to that plugin through the Job DSL extension point .

            The upcoming generic DSL (https://github.com/jenkinsci/job-dsl-plugin/pull/816) will enable support for the Bitbucket Pull Request Builder plugin:

            job('example') {
              triggers {
                bitbucketBuildTrigger {
                  cron('H/1 * * * *')
                  projectPath('')
                  credentialsId('')
                  username('')
                  password('')
                  repositoryOwner('')
                  repositoryName('')
                  branchesFilter('')
                  branchesFilterBySCMIncludes(true)
                  ciKey('')
                  ciName('')
                  ciSkipPhrases('')
                  checkDestinationCommit(true)
                  approveIfSuccess(false)
                }
              }
            }
            
            daspilker Daniel Spilker added a comment - The upcoming generic DSL ( https://github.com/jenkinsci/job-dsl-plugin/pull/816 ) will enable support for the Bitbucket Pull Request Builder plugin: job( 'example' ) { triggers { bitbucketBuildTrigger { cron( 'H/1 * * * *' ) projectPath('') credentialsId('') username('') password('') repositoryOwner('') repositoryName('') branchesFilter('') branchesFilterBySCMIncludes( true ) ciKey('') ciName('') ciSkipPhrases('') checkDestinationCommit( true ) approveIfSuccess( false ) } } }

            People

              daspilker Daniel Spilker
              mgrebenets Maksym Grebenets
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: