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
jenkinsbot to collaborator of repository root/test
- 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
GitHub Pull Request Builder
- GitHub Server API URL =
http://gitbucket:8080/api/v3
- Credentials = select credentials that you created some time ago.
- old version ghprb
- GitHub server api URL =
http://gitbucket:8080/api/v3
- Access Token = created on step 6.
- Save.
- 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/*
- Branches to build
- Branch Specifier (blank for 'any') =
${sha1}
- Build trigger
- GitHub Pull Request Builder
- Save.
-
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.