This page provides information on how to setup Jenkins GitHub pull request builder plugin with GitBucket to automatically build pull-requests with Jenkins.
-
Install Jenkins with GitHub pull request builder plugin as
http://jenkins:9090/ -
Install GitBucket as
http://gitbucket:8080/ -
Create repository on GitBucket as
http://gitbucket:8080/root/test -
Create user on GitBucket for Jenkins as
jenkinsbot- Add
jenkinsbotto collaborator of repositoryroot/test
- Add
-
Add repository webhook
http://jenkins:9090/ghprbhook/ -
Create personal access token on
http://gitbucket:8080/jenkinsbot/_application -
Set on Jenkins global setting
http://jenkins:9090/manage- 'GitHub Plugin Configuration'
- Credentials -> Add
- Type = 'Secret text'
- Secret = created on step 6.
- Add.
- GitHub API URL =
http://gitbucket:8080/api/v3
- Credentials -> Add
GitHub Pull Request Builder- GitHub Server API URL =
http://gitbucket:8080/api/v3 - Credentials = select credentials that you created some time ago.
- GitHub Server API URL =
- old version ghprb
- GitHub server api URL =
http://gitbucket:8080/api/v3 - Access Token = created on step 6.
- Save.
- GitHub server api URL =
- 'GitHub Plugin Configuration'
-
Create job as
http://jenkins:9090/job/testjob/ -
On http://jenkins:9090/job/testjob/configure, * GitHub project =
http://gitbucket:8080/root/test/* Source Code Management- git
- Repositories
- Repository URL =
http://gitbucket:8080/git/root/test.git - Refspec =
+refs/pull/*:refs/remotes/origin/pr/*
- Repository URL =
- Branches to build
- Branch Specifier (blank for 'any') =
${sha1}* Build trigger
- Branch Specifier (blank for 'any') =
- Repositories
- GitHub Pull Request Builder
- Admin list =
root* Save.
- Admin list =
- git
-
Hint
- Jenkins log has a lot information that show on
http://jenkins:9090/log/all. - User that create access token has permission to write repository ?
- When you replace access token, but Jenkins not use soon. please restart Jenkins.