I have set up two Ubuntu 16.04 VMs on Azure, one is for Jenkins, the other is for web app production. They both installed docker engine. Docker for jenkins server is used to create a safe and isolated unit testing enviroment from the host for web app. The production server uses docker to run service and enbrace continous deployment. This article assumes your have basic knowledge of docker and bash script.
We will create the following workflow
- Create Webhook on Github to trigeer Jenkins’ build process.
- Jenkins clone project repo.
- Jenkins build docker image for unit test.
- After testing, Jenkins remove test image and use Publish over SSH plugin to send workspace folder and executes build script on production server.
- Production build new docker image and run immediately.
CI / CD Workflow with Docker and Jenkins on Azure
CI / CD with Jenkins and Docker on Azure — Test and Deploy Node.js Application