This repository contains a demo project created as part of my DevOps studies in the TechWorld with Nana – DevOps Bootcamp.
https://www.techworld-with-nana.com/devops-bootcamp
Demo Project: Configure Webhook to trigger CI Pipeline automatically on every change
Technologies used: Jenkins, GitHub, Git, Docker, Java, Maven
Project Description:
- Install GitHub Plugin in Jenkins
- Configure GitHub access token and connection to Jenkins in GitHub project settings
- Configure Jenkins to trigger the CI pipeline, whenever a change is pushed to GitHub
Verify the following plugins are installed before proceeding:
| Plugin | Purpose |
|---|---|
GitHub Plugin |
Core GitHub integration |
GitHub Integration |
Enables webhook-based triggers |
GitHub Branch Source Plugin |
Required for multibranch pipelines |
How to check / install:
- Go to Manage Jenkins → Plugins → Installed plugins
- Search for each plugin by name
- If missing, switch to the Available tab, find the plugin, and install it
- Go to Manage Jenkins → System → scroll to the GitHub section
- Click Add GitHub Server and fill in:
| Field | Value |
|---|---|
| Name | GitHub |
| API URL | https://api.github.com |
- Navigate to https://github.com/settings/tokens/new
- Set the Note to
jenkins - Select the following scopes:
| Scope | Reason |
|---|---|
admin:repo_hook |
Create, read, and delete webhooks |
public_repo |
Access public repositories |
repo:status |
Update commit statuses |
Note: Add the
reposcope only if you need access to private repositories.
- In the GitHub Server config, click Add next to Credentials → Jenkins
- Choose Secret text and fill in:
| Field | Value |
|---|---|
| ID | github-token |
| Scope | Global |
| Secret | <your generated token> |
- Click Test connection — you should see
Credentials verified - Check Manage hooks so Jenkins can auto-create webhooks on GitHub
- Click Save
- Go to Dashboard → New Item
- Name it
pipelineand select Pipeline
General tab:
- Check
GitHub project - Repo URL:
https://github.com/explicit-logic/jenkins-module-8.4
Build Triggers tab:
- Check
GitHub hook trigger for GITScm polling
Pipeline tab:
| Field | Value |
|---|---|
| Definition | Pipeline script from SCM |
| SCM | Git |
| Repository URL | https://github.com/explicit-logic/jenkins-module-8.4 |
| Credentials | github (GitHub username + password/token) |
| Branch | */pipeline |
| Script Path | Jenkinsfile |
- Click Save
- Navigate to your repo → Settings → Webhooks → Add webhook
- Configure it as follows:
| Field | Value |
|---|---|
| Payload URL | http://<DROPLET_IP>:8080/github-webhook/ |
| SSL verification | Disabled |
| Events | Just the push event |
- Click Add webhook
A multibranch pipeline automatically discovers branches and pull requests, creating a pipeline job for each.
- Go to Dashboard → New Item
- Name it
multibranch, select Multibranch Pipeline, click OK
Branch Sources:
- Click Add source → GitHub
| Field | Value |
|---|---|
| Credentials | github |
| Repository HTTPS URL | https://github.com/explicit-logic/jenkins-module-8.4 |
- Click Validate to confirm access
Behaviors — click Add and include:
Discover branchesDiscover pull requests from origin
Build Configuration:
- Script Path:
Jenkinsfile
Scan Multibranch Pipeline Triggers:
- Check Periodically if not otherwise run → set interval to
1 day
- Click Save — Jenkins will scan the repository and create jobs for each branch




