Operations 11 min read

Concourse CI Tutorial: End-to-End Blue‑Green Deployment with Docker and Cloud Foundry

This guide explains how to set up Concourse CI pipelines for automated blue‑green deployments, covering Docker Toolbox installation, pipeline configuration, unit and load testing, Cloud Foundry deployment, and cleanup steps, enabling zero‑downtime releases for Node.js applications.

DevOps
DevOps
DevOps
Concourse CI Tutorial: End-to-End Blue‑Green Deployment with Docker and Cloud Foundry

Concourse is an open‑source CI tool designed for agile teams that need to orchestrate complex delivery pipelines. It runs tasks, resources, and jobs defined in YAML pipelines, executes builds inside isolated containers, and stores pipeline definitions in version control.

Compared with Jenkins, Concourse offers first‑class pipeline support, container‑based isolation to avoid "snowflake" build servers, and easy access to build logs.

The experiment demonstrates an end‑to‑end blue‑green deployment using Concourse, Docker, Mocha+Chai for unit tests, Artillery for load tests, and Cloud Foundry (Pivotal Web Services) for deployment.

Environment Requirements

OS: Windows 10

Docker Toolbox for Windows

VirtualBox 5.2.8

Required Accounts

GitHub (free account)

Pivotal Web Services (free tier)

Experiment Steps

Install Docker Toolbox and start the Docker Quickstart Terminal, which creates a default VM in VirtualBox.

Verify Docker installation with $ docker run hello-world and pull the Concourse image using $ docker run concourse/concourse --help .

Create a working directory and download the official docker-compose.yml for Concourse. $ mkdir c:/works/lxyprj/concourse-docker $ cd c:/works/lxyprj/concourse-docker $ curl -o docker-compose.yml https://concourse-ci.org/docker-compose.yml $ docker-compose up -d

Configure port forwarding (host 127.0.0.1:8080 → VM 8080) and access the Concourse UI at http://127.0.0.1:8080 .

Download the fly CLI from the UI and place it in the working directory.

Clone the sample pipeline repository, copy the credentials template, and edit ci/credentials.yml with your PWS credentials. $ git clone https://github.com/lxyoutlook/concourse-pipeline-samples $ cd concourse-pipeline-samples/blue-green-app-deployment $ cp ci/credentials.yml.sample ci/credentials.yml $ vi ci/credentials.yml

Update ci/pipeline.yml to point to your own GitHub repository. $ vi ci/pipeline.yml

Target the Concourse instance and set the pipeline: $ /c/works/lxyprj/concourse-docker/fly.exe -t lite login -c http://127.0.0.1:8080 $ /c/works/lxyprj/concourse-docker/fly.exe -t lite set-pipeline -c ci/pipeline.yml -p blue-green-pipeline -l ci/credentials.yml $ /c/works/lxyprj/concourse-docker/fly.exe -t lite unpause-pipeline --pipeline blue-green-pipeline

The pipeline defines two resources (Git and Cloud Foundry), four jobs (unit‑tests, deploy‑app, load‑tests, promote‑new‑version), and five tasks that run Docker images for testing and deployment.

When a code change is pushed to GitHub, Concourse automatically triggers the pipeline: it checks out the code, runs Mocha+Chai unit tests, pushes the app to Cloud Foundry without an external route, performs load testing with Artillery, and finally promotes the new version to production by swapping routes, achieving zero‑downtime blue‑green deployment.

After verification, clean up by stopping and removing the Docker containers, destroying the pipeline with $ fly.exe -t lite destroy-pipeline --pipeline blue-green-pipeline , and deleting the VirtualBox VM.

References: Concourse getting‑started guide, Concourse tutorial site, sample GitHub repository, Docker Toolbox installation documentation.

DockerCI/CDblue-green deploymentpipelineCloud FoundryConcourse
DevOps
Written by

DevOps

Share premium content and events on trends, applications, and practices in development efficiency, AI and related technologies. The IDCF International DevOps Coach Federation trains end‑to‑end development‑efficiency talent, linking high‑performance organizations and individuals to achieve excellence.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.