Differences
This shows you the differences between two versions of the page.
— |
linux_wiki:jenkins_webhooks [2019/06/25 20:13] (current) billdozor created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Jenkins Webhooks ====== | ||
+ | |||
+ | **General Information** | ||
+ | |||
+ | Setting up webhooks which trigger a Jenkins job upon commit to a repo. | ||
+ | |||
+ | **Checklist** | ||
+ | * Jenkins server setup | ||
+ | * GitLab repo available (GitHub may be similar) | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Jobs with Webhooks ====== | ||
+ | |||
+ | Creating a Jenkins job that is triggered upon push to a gitlab project. | ||
+ | |||
+ | * **Create Jenkins job** | ||
+ | * Under "Build Triggers" | ||
+ | * Check: 'Build when a change is pushed to GitLab. GitLab webhook URL: | ||
+ | * Click ' | ||
+ | * Under Secret token, click ' | ||
+ | |||
+ | * **Configure GitLab project settings** | ||
+ | * Settings > Integrations | ||
+ | * Copy/paste webhook url from Jenkins job into URL field | ||
+ | * Copy/paste secret token from Jenkins job into Secret Token field | ||
+ | * Check the Triggers that you want to send a notification to Jenkins about | ||
+ | * Optionally, uncheck ' | ||
+ | * Click "Add webhook" | ||
+ | |||
+ | * **Configure GitLab project members** | ||
+ | * Go to Settings > Members | ||
+ | * Ensure that the user configured to clone the project in the Jenkins job has " | ||
+ | * This will ensure that the job can write back job status to the gitlab commit (job running, success, failed, etc) | ||
+ | |||
+ | ---- | ||