Saturday, 2 March 2019

DevOps Project - To Implement Code-Build-Deliver-Deploy Process using Github, Jenkins, Docker Hub and Docker.




For premium DevOps and AWS Courses: https://imojo.in/2cox7em
  1. AWS with the project 
  2. DevOps Real-Time 
  3. DevOps with the project 
  4. AWS Real-Time
  5. Linux Admin





The description of the dataset is mentioned below

·         Jenkins Server should be able build docker image from  code and Dockerfile
·         Jenkins Server should be able to deliver Docker image to different registries
·         Jenkins Server should be able to deploy docker image in target environment


Problem statement:


¨      Can we create Docker image using Jenkins
¨      Can we publish Docker image using Jenkins
¨      Can we deliver Docker image using Jenkins
¨      Can we deploy a Docker Container using Docker image and Jenkins



Lab Environment: We need one Virtual Machine Jenkins and Docker installed on it

We will use same Virtual Machine as target environment







Hints for doing Project Work

1.    Create a New Virtual Machine

2.   Setup Jenkins on it
3.   Install Docker on it
4.   Add “Docker” Plugin  and “Publish over SSH” Plugin
5.   Add New Docker Agent with benhall/dind-jenkins-agent:v2 template
6.   Point to Same Virtual Machine and Docker Installation
7.   Add a New Target Server for Publish over SSH” Plugin
8.   Create a new Jenkins Free Style Job
9.   Restrict Job to Run on Docker Node
1.  Use Git for Source code build, use any source code with Dockerfile(e.g.                   https://github.com/devopsguru91/catnip.git)



11.  Use Docker native build command to build docker image
12.  Use Jenkins Build Number as Docker Image Build Number
13.  Put latest tag to it
14.  Push Image to Docker Hub
15.  Add “Send files or execute commands over ssh” step
16.  Add a new Target Virtual Machine or use same machine as Target Host
17.  Execute command to deploy docker image and start the container
18.  Validate Expected Results