Skip to main content

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 uses agent any, allowing Jenkins to run the pipeline on any available agent.

Environment Variables

IMAGE_NAME
string
default:"nodejs-demo-app"
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
These hooks provide visibility into pipeline execution status and enable custom notifications or cleanup actions.

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:
  1. Ensure Docker is installed on the Jenkins agent
  2. Configure Jenkins with necessary permissions
  3. Create a new Pipeline job in Jenkins
  4. Point to the Jenkinsfile in your repository
  5. 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

Build docs developers (and LLMs) love