Pipeline Architecture
This Jenkins CI/CD pipeline automates the entire software delivery process from code checkout to production deployment. The pipeline is designed for a Node.js application and uses Docker for containerization.Workflow Diagram
The pipeline executes the following sequential workflow:Pipeline Components
Agent Configuration
The pipeline usesagent any, allowing Jenkins to run the pipeline on any available agent.
Environment Variables
The Docker image name used throughout the pipeline stages
Pipeline Stages
The pipeline consists of four main stages:Clone
Clones the source code from the GitHub repository
Build
Builds a Docker image from the application source code
Test
Installs dependencies and runs the test suite
Deploy
Deploys the containerized application on port 80
Post-Build Actions
The pipeline includes three post-build hooks:- always: Executes regardless of pipeline outcome
- success: Executes only when all stages succeed
- failure: Executes when any stage fails
Application Details
The pipeline deploys a Node.js Express application that:
- Runs on port 3000 internally
- Maps to port 80 externally
- Serves a simple “Hello” message at the root endpoint
Quick Start
To run this pipeline:- Ensure Docker is installed on the Jenkins agent
- Configure Jenkins with necessary permissions
- Create a new Pipeline job in Jenkins
- Point to the Jenkinsfile in your repository
- Trigger the build
Next Steps
Jenkinsfile Reference
View the complete Jenkinsfile with detailed annotations
Stage Documentation
Deep dive into each pipeline stage
Deployment Process
Learn about Docker deployment and port mapping