Coder Social home page Coder Social logo

kiic-leung / bitbucket-pullrequest-builder-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nishio-dens/bitbucket-pullrequest-builder-plugin

0.0 1.0 0.0 282 KB

Bitbucket Pull Request Builder Plugin for Jenkins

License: Other

Java 97.87% HTML 2.13%

bitbucket-pullrequest-builder-plugin's Introduction

Bitbucket Pull Request Builder Plugin

This Jenkins plugin builds pull requests from Bitbucket.org and will report the test results.

Current Maintainer(s):

Build Status

Build Status

Prerequisites

Creating a Job

  • Create a new job
  • Select and configure Git SCM
    • Add Repository URL, [email protected]:${repositoryOwner}/${repositoryName}.git
    • In Branch Specifier, type */${sourceBranch}
  • Under Build Triggers, check Bitbucket Pull Request Builder
  • In Cron, enter crontab for this job.
    • e.g. * * * * * will check for new pull requests every minute
  • In Bitbucket BasicAuth Username, write your bitbucket username, like [email protected]
  • In Bitbucket BasicAuth Password, write your password
  • In CI Identifier, enter an unique identifier among your Jenkins jobs related to the repo
  • In CI Name, enter a human readable name for your Jenkins server
  • Write RepositoryOwner
  • Write RepositoryName
  • Save to preserve your changes

Jenkins pipeline

pipeline {
    agent any
    triggers{
        bitbucketpr(projectPath:'<BIT_BUCKET_PATH>',
        cron:'H/15 * * * *',
        credentialsId:'',
        username:'',
        password:'',
        repositoryOwner:'',
        repositoryName:'',
        branchesFilter:'',
        branchesFilterBySCMIncludes:false,
        ciKey:'',
        ciName:'',
        ciSkipPhrases:'',
        checkDestinationCommit:false,
        approveIfSuccess:false,
        cancelOutdatedJobs:true,
        commentTrigger:'')
    }
}

After you set up your Jenkins pipeline, run the job for the first time manually (otherwise the trigger may not work!)

Merge the Pull Request's Source Branch into the Target Branch Before Building

You may want Jenkins to attempt to merge your PR before building. This may help expose inconsistencies between the source branch and target branch. Note that if the merge cannot be completed, the build will fail immediately.

  • Follow the steps above in "Creating a Job"
  • In the "Source Code Management" > "Git" > "Additional Behaviors" section, click "Add" > "Merge Before Building"
  • In "Name of Repository" put "origin" (or, if not using default name, use your remote repository's name. Note: unlike in the main part of the Git Repository config, you cannot leave this item blank for "default").
  • In "Branch to merge to" put "${targetBranch}"
  • Note that as long as you don't push these changes to your remote repository, the merge only happens in your local repository.

If you are merging into your target branch, you might want Jenkins to do a new build of the Pull Request when the target branch changes.

  • There is a checkbox that says, "Rebuild if destination branch changes?" which enables this check.

Rerun a Build

If you want to rerun a pull request build, write a comment on your pull request reading “test this please”.

Environment Variables Provided

  • sourceBranch
  • targetBranch
  • repositoryOwner
  • repositoryName
  • pullRequestId
  • destinationRepositoryOwner
  • destinationRepositoryName
  • pullRequestTitle
  • pullRequestAuthor

Contributing to Bitbucket Pull Request Builder Plugin

Donations

Do you like this plugin? feel free to donate!

Paypal: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LTXCF78GJ7224

BTC: 1KgwyVzefeNzJhuzqLq36E3bZi2WFjibMr

Thank you!

Copyright

Copyright © 2018 S.nishio + Martin Damovsky + David Frascone

License

  • BSD License
  • See COPYING file

bitbucket-pullrequest-builder-plugin's People

Contributors

atsushi-ageet avatar b-studios avatar chrisleetw avatar codemonk avatar csomme-atl avatar dahlgren avatar damovsky avatar dzoellner avatar elifarley avatar fonsecas72 avatar frodeaa avatar gazal-k avatar iridias avatar jf-unsilo avatar jninnes avatar limonte avatar maxvodo avatar mgrebenets-fairfax avatar michaeljb avatar nblair avatar nfalco79 avatar nishio-dens avatar nwoolls avatar page- avatar pedrohrr avatar rojepp avatar rpanak-generalbytes avatar tkelley-eg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.