Task 2

This task is a complete end to end automation using Jenkins, docker on the base OS red hat 8. This task consists the following sub tasks.

Job1:- Create container image that’s has Jenkins installed using docker file and when we launch this image, it should automatically starts Jenkins service in the container.

No alt text provided for this image

This dockerfile contains one expect language along with the jenkins software.

Using expect language I created Keygen it will automatically create a public key which is used for authenticate while ssh, Copyid it will copy the public key to the base OS and for which it used remote host name and password for the base OS . For taking remote host name and password the environmental variable is used and to run this container it must be initialized.

No alt text provided for this image

Job2:- Create a job chain of job1, job2, job3 and job4 using build pipeline plugin in Jenkins.

No alt text provided for this image

Job3:- Create a job1 which pulls the Github repo automatically when some developers push repo to Github.

No alt text provided for this image

This job pulls the github repo from the developer's repo and after that it will create the production directory inside the jenkin's container and move the files inside that folder.

Job4:- Create a job2 which will 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 ).

No alt text provided for this image

Job4 do this by first store each kind of files(for simplicity I took 2 kind of file i.e php and html) in arrays.

Then for each kind of files stored in two arrays it will transfer the each file in the base OS i.e red hat via scp protocol and then start the container that contain respective language interpreter(for HTML I have used httpd image and for php image which has PHP and Apache server pre installed).

Job5:- Test your app if it is working or not.

No alt text provided for this image


This job uses exit code of curl command to determine weather the app is running or not.

Job6:- if app is not working , then send email to developer with error messages.

No alt text provided for this image

Job7:- Create One extra job job5 for monitor : If container where app is running. fails due to any reason then this job should automatically start the container again.

No alt text provided for this image


To view or add a comment, sign in

More articles by Akshit Saini

  • What is Kubernetes and its industries use cases.

    Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that…

  • Companies benefited from AWS.

    Cloud computing is a term referred to storing and accessing data over the internet. It doesn't store any data on the…

  • What exactly is Big Data?

    It all starts with the explosion in the amount of data we have generated since the dawn of the digital age. This is…

    1 Comment
  • Task 1

    The purpose of this task to automate the of the production team. In simple way this task automatically first clone the…

  • Cloud Computing

    automated system using #terraform for Amazon #Aws #cloud which doesn't requires human interaction after running it…

    2 Comments
  • MLOPS task -3

    Problems with their ideas are below:- Job1 : Pull the Github repo automatically when some I push repo to Github. Job2 :…

    2 Comments

Explore content categories