Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Commit 09a3ec8

Browse files
author
Bernhard Grünewaldt
committed
doc
1 parent 6b390fe commit 09a3ec8

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

README.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,39 @@ This is how you need to configure the GitHub Webhook in your repository 'Setting
5858

5959
<p align="center"><img src="https://codeclou.github.io/jenkins-github-webhook-build-trigger-plugin/img/github-webhook-settings---with-overlays.png?v4" width="80%"></p>
6060

61+
-----
6162

62-
### Jenkins Job Configuration
63-
64-
65-
<p align="center"><img src="https://codeclou.github.io/jenkins-github-webhook-build-trigger-plugin/img/jenkins-source-code-management.png" width="80%"></p>
66-
67-
<p align="center"><img src="https://codeclou.github.io/jenkins-github-webhook-build-trigger-plugin/img/jenkins-build-trigger.png" width="80%"></p>
68-
69-
70-
### Example Trigger
63+
&nbsp;
7164

72-
We can see in the Response Tab of a GitHub Webhook Delivery that we notify the Git-Plugin with a specific sha1 commit id.
65+
### Jenkins Job Configuration
7366

74-
<p align="center"><img src="https://codeclou.github.io/jenkins-github-webhook-build-trigger-plugin/img/webhook-specific-commit-id.png" width="80%"></p>
67+
Configure your Jenkins Job like this so that it gets triggered by the Webhook events.
7568

76-
And that triggers this exact id for the exact branch/tag that has been sent by the Webhook as JSON payload.
69+
First of all the **naming conventions** is `{repositoryOwner}---{repositoryName}.*`.
70+
That means if your repository is `https://github.com/codeclou/test-webhook.git` then your job must be called
71+
`codeclou---test-webhook`. You can have multiple jobs if you want for example a job that handles releases, just call it `codeclou---test-webhook-release`.
7772

78-
<p align="center"><img src="https://codeclou.github.io/jenkins-github-webhook-build-trigger-plugin/img/jenkins-build-by-commit-id.png" width="80%"></p>
73+
We do not use 'Source Code Management' and we do not need to specify some 'Build Triggers' since it is all done
74+
magically by convention over configuration.
7975

76+
<p align="center"><img src="https://codeclou.github.io/jenkins-github-webhook-build-trigger-plugin/img/jenkins-job-config---with-overlays.png" width="80%"></p>
8077

8178

8279

80+
Available variables:
81+
```bash
82+
#!/bin/bash
83+
84+
echo "GWBT_COMMIT_BEFORE: $GWBT_COMMIT_BEFORE"
85+
echo "GWBT_COMMIT_AFTER: $GWBT_COMMIT_AFTER"
86+
echo "GWBT_REF: $GWBT_REF"
87+
echo "GWBT_TAG: $GWBT_TAG"
88+
echo "GWBT_BRANCH: $GWBT_BRANCH"
89+
echo "GWBT_REPO_CLONE_URL: $GWBT_REPO_CLONE_URL"
90+
echo "GWBT_REPO_HTML_URL: $GWBT_REPO_HTML_URL"
91+
echo "GWBT_REPO_FULL_NAME: $GWBT_REPO_FULL_NAME"
92+
echo "GWBT_REPO_NAME: $GWBT_REPO_NAME"
93+
```
8394
-----
8495

8596
&nbsp;

0 commit comments

Comments
 (0)