Full-Stack CI/CD with Jenkins: Auto-Builds, GitHub Webhooks & Dockerized Django

I'm a passionate Computer Science student specializing in DevOps, cloud technologies, and powerlifting. I've completed several certifications, including AWS Cloud Practitioner and Googleโs Generative AI badge, and I'm currently exploring both AWS and Azure to build scalable, efficient CI/CD pipelines.
Through my blog posts, I share insights on cloud computing, DevOps best practices, and my learning journey in the tech space. I enjoy solving real-world problems with emerging technologies and am developing a platform to offer career advice to students. Outside of tech, I'm a competitive powerlifter, constantly striving to improve and inspire others in fitness.
Always eager to connect with like-minded individuals and collaborate on projects that bridge technology and personal growth.
In this article, I will show you how to:
Create a Jenkins Pipeline
Install required plugins
Configure GitHub Webhook
Enable automatic build trigger
Deploy a Django app using Docker
View pipeline stages using Stage View
This is a complete CI/CD implementation.
๐ข Step 1: Install Required Plugin (Stage View)
๐ Screenshot: Manage Jenkins โ Plugins โ Available Plugins
Search for:
Pipeline Aggregator View
๐น What is Pipeline Aggregator View?
Shows visual Stage View
Displays build history
Shows stage duration
Displays success/failure in green/red
Click Install.
๐ข Step 2: Create New Pipeline Job
๐ Screenshot: New Item Page
Click New Item
Enter name:
djangocicdSelect Pipeline
Click OK
๐ข Step 3: General Configuration
๐ Screenshot: General Section
๐น Description
This is a CI/CD for a Django app
๐น GitHub Project (Enable)
Add repository URL:
https://github.com/LondheShubham153/django-notes-app.git
This connects Jenkins to GitHub.
๐น Other Options Explained
| Option | Purpose |
|---|---|
| Discard Old Builds | Saves storage |
| Do Not Allow Concurrent Builds | Prevents multiple runs |
| Pipeline Speed/Durability Override | Performance tuning |
| Preserve Stashes | Keeps temporary files |
| This Project is Parameterized | Allows runtime parameters |
| Throttle Builds | Limit parallel builds |
๐ข Step 4: Configure Build Triggers
๐ Screenshot: Trigger Section
Enable:
โ GitHub hook trigger for GITScm polling
This allows Jenkins to build automatically when code is pushed.
Other options explained:
| Option | Use |
|---|---|
| Build Periodically | Cron-based build |
| Poll SCM | Checks repo every few minutes |
| GitHub Pull Requests | PR trigger |
| Build After Other Projects | Chain jobs |
๐ข Step 5: Pipeline Script Configuration
๐ Screenshot: Pipeline Script Editor
Definition โ Select:
Pipeline Script
Now paste this complete script:
pipeline {
agent {
label "hunter"
}
stages {
stage("code") {
steps {
echo "Cloning the code"
git url: "https://github.com/LondheShubham153/django-notes-app.git", branch: "main"
echo "Code cloned successfully"
}
}
stage("build") {
steps {
echo "Building Docker image"
sh "whoami"
sh "docker build -t notes-app:latest ."
echo "Build successful"
}
}
stage("test") {
steps {
echo "Running tests"
}
}
stage("deploy") {
steps {
echo "Deploying container"
sh "docker rm -f notes-app-container || true"
sh "docker run -d -p 8000:8000 --name notes-app-container notes-app:latest"
echo "Deployment successful"
}
}
}
post {
always {
echo "Pipeline finished"
}
success {
echo "Pipeline executed successfully"
}
failure {
echo "Pipeline failed"
}
}
}
๐น Use Groovy Sandbox
Keep this enabled for security.
๐ข Step 6: Setup GitHub Webhook
๐ Screenshot: GitHub โ Settings โ Webhooks
Click Add Webhook
๐น Payload URL
If using ngrok:
https://your-ngrok-url/github-webhook/
Example from screenshot:
https://unviolably-exostotic-cory.ngrok-free.dev/github-webhook/
๐น Content Type
Select:
application/json
๐น Secret
Optional but recommended for security.
๐น SSL Verification
Options:
| Option | Meaning |
|---|---|
| Enable SSL Verification | Secure (Recommended) |
| Disable | Not recommended |
๐น Which Events to Trigger?
Select:
Send me everything
Or choose:
Just the push event
๐น Active
Make sure checkbox is enabled.
Click Update Webhook
๐ข Step 7: How Webhook Works
When you push code:
GitHub sends POST request to Jenkins
Jenkins receives webhook
Pipeline automatically starts
Stages execute sequentially
Docker container gets deployed
๐ข Step 8: Stage View (Visual Pipeline Monitoring)
๐ Screenshot: Jenkins Stage View
You will see:
| Stage | Status | Time |
|---|---|---|
| code | โ Green | 3s |
| build | โ Green | 1min 42s |
| test | โ Green | 41ms |
| deploy | โ Green | 3s |
๐น What Stage View Shows
Build number (#11, #10, #9)
Stage duration
Average time
Success/Failure color coding
Green โ Success
Red โ Failed
๐ข Step 9: Access the Deployed Application
After deployment:
http://<server-ip>:8000
If running locally:
http://localhost:8000
๐ข Complete CI/CD Flow Architecture
Developer โ Push Code โ GitHub โ
Webhook โ Jenkins โ
Build โ Test โ Deploy โ
Docker Container Running
๐ฏ Final Output
When everything is correct, you will see:
All stages green
Console output showing deployment
Running container on port 8000
Automatic trigger on every push
๐ฅ What Makes This Production-Ready?
Automated build
Dockerized deployment
Webhook integration
Stage monitoring
Error handling using post block
Container recreation logic
๐ Conclusion
In this guide, we:
โ Installed required plugin
โ Created pipeline job
โ Configured triggers
โ Wrote Declarative Jenkinsfile
โ Configured GitHub Webhook
โ Deployed Django app using Docker
โ Monitored pipeline using Stage View
This is a complete real-world CI/CD implementation.




