日本語 : GitHub プルリクエストビルダープラグイン

このプラグインはGitHubでのプルリクエストをビルドし、結果を報告します。

Plugin Information

View GitHub Pull Request Builder on the plugin site for more information.

Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:

新しいプルリクエストがプロジェクトの中で未解決でプルリクエストした人がホワイトリストに登録されていないとき、ビルダーは「管理者はこのパッチを検証できますか?」と尋ねます。管理者はテスト目的でこのプルリクエストを許可するために「テストすることを許可」、一度のテストの実行目的で「これをテストしてください」そしてプルリクエストした人をホワイトリストに追加するのに「ホワイトリストに登録せよ」とコメントすることができます。

プルリクエストした人がホワイトリストに登録されている場合、新たなプルリクエストやコミットを既存のプルリクエストに追加することで、新しいビルドを開始します。

新しいビルドは「これを再テストしてください」のようなコメントで開始することもできます。

インストール:

  • I recomend to create GitHub 'bot' user that will be used for communication with GitHub (however you can use your own account if you want).
  • The user needs to have push rights for your repository (must be collaborator (user repo) or must have Push & Pull rights (organization repo)).
  • If you want to use GitHub hooks have them set automatically the user needs to have administrator rights for your repository (must be owner (user repo) or must have Push, Pull & Administrative rights (organization repo))
  • Install the plugin.
  • Go to "Manage Jenkins" -> "Configure System" -> "Github pull requests builder" section.
  • If you are using Enterprise GitHub set the server api URL in "Github server api URL". Otherwise leave there "https://api.github.com".
  • Set your 'bot' user's Access Token.
    • If you don't have generated your access token you can generate one in "Advanced...".
      • Set your 'bot' user's GitHub username and password.
      • Press the "Create Access Token" button
      • Copy the generated Access Token into the field "Access Token"
      • Clear the username and password fields
    • If you don't want to use Access Token leve the field empty and fill the username and password in "Advanced...".
  • Add GitHub usernames of admins (these usernames will be used as defaults in new jobs).
  • Under Advanced, you can modify:
    • The phrase for adding users to the whitelist via comment. (Java regexp)
    • The phrase for accepting a pullrequest for testing. (Java regexp)
    • The phrase for starting a new build. (Java regexp)
    • The crontab line. This specify default setting for new jobs.
  • Save to preserve your changes.

ジョブの作成:

  • Create a new job.
  • Add the project's GitHub URL to the "GitHub project" field (the one you can enter into browser. eg: "https://github.com/janinko/ghprb")
  • Select Git SCM.
  • Add your GitHub "Repository URL".
  • Under Advanced, set "refspec" to
    +refs/pull/*:refs/remotes/origin/pr/*
  • In "Branch Specifier", enter "${sha1}".
  • Under "Build Triggers", check "Github pull requests builder".
    • Add admins for this specific job.
    • If you want to use GitHub hooks for automatic testing, read the help for "Use github hooks for build triggering" in job configuration. Then you can check the checkbox.
    • In Advanced, you can modify:
      • The crontab line for this specific job. This schedules polling to GitHub for new changes in Pull Requests.
      • The whitelisted users for this specific job.
      • The organisation names whose members are considered whitelisted for this specific job.
  • Save to preserve your changes.
    Make sure you DON'T have "Prune remote branches before build" advanced option selected, since it will prune the branch created to test this build.

If you want to manually build the job, in the job setting check "This build is parameterized" and add string parameter named "sha1". When starting build give the "sha1" parameter commit id you want to build or refname (eg: "origin/pr/9/head").

変更履歴

1.7

Support autoclose at build level
add pull id and target branch to environment variables
fix GitHub Hooks when authentication is required on Jenkins
various bugfixes and improvements

1.7

implemented support for GitHub hooks
added button for generating api token

1.6

option for specifing how to mark unstable builds in github
Close failed pull requests automatically if plugin admin configured it
customizeable pass/fail comments
Refactoring of code
help description in Jenkins configuration

1.5

checkbox enabling sending comments when update of comment status fails
option to enter organisations which members are whitelisted
support for enterprise Git Hub
link to pullrequest into build description
fixes

1.4

Changed comment commands - phrases for testing once, pullrequest or add user to whitelist
"test this please" starts new build
"ok to test" allow pullrequest for building
"add to whitelist" add user to whitelist

1.3

Add published URL feature.
Enable connection to github enterprise instances.
Enable authentication via a token.
When automatic merge is possible, build the merge.

1.2

Use commit status api instead of comments for reporting results.

type key summary

Can't show details. Ask your admin to whitelist this Jira URL.

View these issues in Jira