Skip to content

Latest commit

 

History

History
114 lines (73 loc) · 3.32 KB

readme.md

File metadata and controls

114 lines (73 loc) · 3.32 KB

Phabricator-Jenkins Plugin Build Status

This plugin provides Phabricator integration with Jenkins. It allows Jenkins to report build status and coverage information over Harbormaster (or via comments if Harbormaster is not enabled).

Configuration

Navigate to https://ci.example.com/configure, replacing ci.example.com with the URL for your Jenkins instance.

Enter the URL of your Phabricator install, and optionally your Uberalls instance.

Configure globally

Usage

To enable Harbormaster integration, add two string parameters to your jenkins job: DIFF_ID and PHID:

Configure job parameters

To apply the differential to your workspace before test runs, enable the "Apply Phabricator Differential" step under "Build Environment":

Enable build environment

By default, this will reset to the base commit that the differential was made from. If you wish to apply the patch to master instead, select "Apply patch to master".

To report the build status back to Phabricator after your test run, enable the "Post to Phabricator" Post-build Action:

Add post-build action

If you have Uberalls enabled, enter a path to scan for cobertura reports.

Harbormaster

Once the plugin is configured, you will want to enable harbormaster via herald rules to trigger jenkins builds on differentials.

First, create a new Harbormaster build plan with a single step, "Make an HTTP POST request":

Set the URI to https://ci.example.com/buildByToken/buildWithParameters?job=test-example&DIFF_ID=${buildable.diff}&PHID=${target.phid}, replacing https://ci.example.com with the URI of your Jenkins instance, and test-example with the name of your job. If your Jenkins instance is exposed to the internet, make sure to install the Build Token Root Plugin and fill in the token parameter.

Set the "When Complete" dropdown to "Wait For Message"

Harbormaster plan

Additional Comments

To allow projects to post back additional text instead of just pass/fail, the plugin supports a build comment file, which defaults to .phabricator-comment. Put text in here, and Jenkins will add it to the build status comment.

Herald

Next, create a Global herald rule:

Herald rule

Fill in your repository name and build plan.

Test it out

Try arc diff-ing on your repo. If everything goes well, you should see Jenkins commenting on your diff:

Example

Development

Set up your maven file according to https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

Testing

Start up Jenkins with the plugin installed

mvn hpi:run

Open your browser to your local instance

License

MIT Licensed