|
1 | 1 | # jenkins-github-webhook-build-trigger-plugin |
2 | 2 |
|
| 3 | +Trigger Jenkins Jobs via GitHub Webhooks and provide Webhook Payload Information as Environment Variables inside your Job. |
3 | 4 |
|
| 5 | +----- |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +### Is this for me? |
| 10 | + |
| 11 | +If you can agree with all statements, then this is for you. |
| 12 | + |
| 13 | + * [Bash](http://tiswww.case.edu/php/chet/bash/bashtop.html) is love. Bash is live. |
| 14 | + * Using the [git commandline client](https://git-scm.com/book/en/v2/Getting-Started-The-Command-Line) in Jenkins Jobs: |
| 15 | + * gives me the control I want and need. |
| 16 | + * replaces all other mostly defunct and/or bloated Git Plugins. |
| 17 | + * I only use GitHub.com for my repositorys. |
| 18 | + * I only 'git clone' via `https://` URLs. |
| 19 | + * I work with git branches and tags. |
| 20 | + * I want my Jenkins jobs triggered at every push (branch or tag). |
| 21 | + * I want my Jenkins jobs triggered exclusively via GitHub Webhook Push Events. |
| 22 | + * I use Linux to run Jenkins. |
| 23 | + * I want my Jenkins jobs triggered automatically by convention of configuration job naming. |
| 24 | + |
| 25 | +Ok. Still here?! Then this might be for you :bowtie: |
| 26 | + |
| 27 | +----- |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +### How it works in three sentences |
4 | 32 |
|
5 | | -### What it does |
| 33 | + * It parses the actual GitHub Webhook JSON Payload and extracts its information. |
| 34 | + * It triggers all Jenkins jobs matching `{repositoryOwner}---{repositoryName}.*` |
| 35 | + * It injects Environment Variables into the job run for you to determine what branch and revision is to clone. |
6 | 36 |
|
7 | | - * It parses the actual GitHub Webhook JSON Payload |
8 | | - * Extracts the Repository Clone URL and the Git Commit ID |
9 | | - * It triggers the Git-Plugins notifyTrigger with the fixed commit id |
10 | | - * That way tags and branches are build even if they have the same revision |
11 | | - * (a git push of a tag has a unique commit id but the same revision) |
12 | 37 |
|
| 38 | +----- |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +### How to build the plugin |
| 43 | + |
| 44 | +Jave Oracle Java 8 and Apache Maven 3 installed. And then build like this: |
| 45 | + |
| 46 | +```bash |
| 47 | +git clone https://github.com/codeclou/jenkins-github-webhook-build-trigger-plugin.git |
| 48 | +cd jenkins-github-webhook-build-trigger-plugin |
| 49 | +mvn clean |
| 50 | +mvn compile |
| 51 | +mvn hpi:hpi |
| 52 | +``` |
| 53 | + |
| 54 | +Now you should have a file called `./target/github-webhook-notifier-plugin.hpi` which |
| 55 | +you can upload manually to Jenkins under 'Manage Plugins' → 'Advanced' → 'Upload Plugin'. |
| 56 | + |
| 57 | +----- |
| 58 | + |
| 59 | + |
13 | 60 |
|
14 | 61 | ### Why? |
15 | 62 |
|
|
0 commit comments