参考Jenkins gitee plugins配置说明中的关键配置项:
Jenkins 配置:
Configure System -> Gitee Configuration:
- Connection name: test
- Gitee host URL: https://gitee.com
- Credentials -> add
- Enable “Ignore SSL Certificate Errors”
- Click “Test Connection”
Jenkins->New Item:
- Gitee connection -> select “test”
- Source Code Management -> Git
- Repository URL: https://gitee.com/account/test.git
- Refspec: +refs/pull/*/MERGE:refs/pull/*/MERGE
- Select “Credentials”
- Branches to build -> Branch Specifier : pull/${giteePullRequestIid}/MERGE
- Build Triggers -> Build when a change is pushed to Gitee
- Select “Opened Pull Requests Events”
- “Updated Pull Requests Events” -> Select “Both …”
- Secret Token for Gitee WebHook: Input token from webhook
- Post-build Actions -> Add note with build status on Gitee pull requests
- Select “Custom message on success”
Build and package success 😃 Jenkins Build Info:
- JOB_NAME=${JOB_NAME}
- JOB_URL: ${JOB_URL}
- BUILD_NUMBER=${BUILD_NUMBER}
- BUILD_URL: ${BUILD_URL}
- Select “Custom message on failure”
Build and package !!! failed !!! Jenkins Build Info:
- JOB_NAME=${JOB_NAME}
- JOB_URL: ${JOB_URL}
- BUILD_NUMBER=${BUILD_NUMBER}
- BUILD_URL: ${BUILD_URL}
Apply.
Gitee部分
Setting-> webhooks-> add
http://x.x.x.x:8888/jenkins/project/Jenkins-item-name WebHook Password/Sign-> Select “WebHook Password” -> input password 来至Jenkins生的密码. Events: Select “Pull Request”
|