First, the role
- Using Webhooks to implement the GIT Client push code to Gitlab, Jenkins will immediately go to Gitlab and build the replacement code.
Second, step
1, install the plug-in
- Ruby_runtime (Hook plugin depends on the plugin)
- Gitlab Hook Plugin
2. Jenkins Global Configuration
System Management, System settings
Description: Make a two tick and build a branch
3. Jenkins project configuration
Project, "Configuration"
Note: Tick "poll SCM", but the time expression is empty.
4, Gitlab Webhook configuration
Attention:
- The URL is http./jenkins-server/gitlab/notify_commit
- Tick "Push Events"
- SSL Not applicable
After that, click on the "Test" button below to test
Third, testing
After modifying the code,
- git add--all
- git commit-m "xxx"
- Git push Origin Head:dev
View the compilation of Jenkins.
41st Micro Service CICD (3)-Jenkins + Gitlab + webhooks + publish-over-ssh (1)