Task 2

1. Firstly ,create a container image that has jenkins installed using Dockerfile so whenever we launch the container image it should automatically starts the jenkins service in the container.

2.Secondly,create a a chain of jobs(5) using build pipeline plugin in Jenkins which will help to fetch source code, start service, test service, notify the status and in case of failure it will launch new environment in less than a minute .

3. JOB1:--Pull the Github repository automatically when some developers push repository to the Github.

4. JOB2:- By looking at the code or program file, Jenkins should automatically start the respective language interpreter install image container to deploy code eg:- If code is of PHP, then Jenkins should start the container that has PHP already installed 

5.JOB3:- This job for testing our application whether it is working or not

6.JOB4:-The role of this job comes into play when the third job failed due to any reason. It means whenever our application is  not working then we will use python script in this job to sent email to the developer with error messages.

7.JOB5:- Create one extra job namely JOB5 for monitoring which will see whether our workspace is doing well or not if found it failing it will immediately launch a new container with the same configuration.

STEP 1- In this step, we created a Dockerfile & run the build command. An image with mytask2 is created and a container is launched with jenkins .

No alt text provided for this image
No alt text provided for this image

STEP 2:As soon as the container launched , the jenkins can be acessed with port no 9000 then we can configure the jenkins .

No alt text provided for this image

STEP 3:- JOB1 starts, after pushing the files in the github , the job 1 of the jenkins starts and it pulls all the files from the github as soon as the developer pushes into the repo. Here i used the Poll Scm but we can also use the webhook.

No alt text provided for this image

STEP 4:- JOB2 startsThis will be triggered as soon as Job1 completes and will deploy a containers on the host system. Here I have taken the example of webpages of php and html, so I have used the apache webserver.

No alt text provided for this image

STEP 5:- JOB3 startsJob3 will be successfully built if the test fails so it can go to Job4 and mail to dev.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

STEP 6:- JOB4 starts , It is the email notification sent by the QAT to the developer that the websites has been checked. And it is working fine , if developer doesn't get any notification then there is a some problem.

Here, i created a python code but you can also use a jenkins plugin for email notification.

No alt text provided for this image


STEP 7:- JOB5 startsThis job check every minute, if the deployed container is up or not. If not, it restart the container again.

No alt text provided for this image
No alt text provided for this image


CREATION OF BUILD PIPELINE VIEW:-

No alt text provided for this image


To view or add a comment, sign in

More articles by kanakam Sushma

  • Usecases of MongoDB

    What is MongoDB? MongoDB is an open-source document database that provides high performance, high availability, and…

  • Amazon SQS

    What is Aws SQS? Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to…

  • Task 1-Integration of Github with Docker and jenkins

    I created a local repository where I put my code . This Repository is also Known as Work-Space .

  • My TECHNICAL JOURNEY in ART

    HI Everyone,am KANAKAM SUSHMA btech final year from the branch of Computer Science Engineering.I like share here my…

  • 7.1 B Task Increasing/Decreasing static partition in Linux 7.2 Docker Task

    7.1 B Task Increasing/Decreasing static partition in Linux Step 1: First attach the storage (say 12 GB) Step 2: Run…

  • Kubernetes

    What is Kubernetes? This page is an overview of Kubernetes. Kubernetes is a portable, extensible, open-source platform…

Others also viewed

Explore content categories