Skip to content

Latest commit

 

History

History
41 lines (36 loc) · 2.08 KB

Docker-Pipeline.md

File metadata and controls

41 lines (36 loc) · 2.08 KB

This demo will show how to set up a Docker-based build and deploy pipeline in Jenkins.

  • Master in AWS running Jenkins 2.7.2
  • Agent is an AWS EC2 instance with Docker, Maven, Git, and Java 8 installed on Ubuntu connected to Jenkins with an SSH Connector
  • Staging server is running in ECS
  • Deployment server is running in ECS

Required Plugins

  • CloudBees Docker Pipeline Plugin
  • Pipeline Plugin
  • Docker Plugin
  • Pipeline Stage View Plugin
  • CloudBees Docker Build and Publish Plugin
  • CloudBees Custom Build Environments Plugin
  • CloudBees AWS CLI Plugin - CJE proprietary plugin

Required agent tools

  • Maven
  • Java
  • Git
  • Docker w/ running Docker daemon

Actual Flow

  • A Jenkins pipeline job builds this project
  • Any push to the source code will trigger pipeline to:
  • Pull the source code from this GitHub repostiory
  • Run the Maven tests
  • Build the application
  • Package the application in a Docker image using this repo's Dockerfile
  • Deploy the application's Docker image to DockerHub with a "docker-demo" tag
  • Deploy the image to a staging server in Amazon's container service (ECS) and prompt for manual approval
  • Kill the previously running production container in ECS
  • Deploy the latest image into ECS

Additional Reading