Automation: Git, Docker and Jenkinns

   Task Details:

  1. Create container image that’s has Jenkins installed using dockerfile

2. When we launch this image, it should automatically starts Jenkins service in the container.

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

4. Job1 : Pull the Github repo automatically when some developers push repo to Github.

5. 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 ).

6. Job3 : Test your app if it is working or not.

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

8. 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



   Using Dockerfile an image for jenkin server is created on the top of centos docker image.

   

     build image from docker file using command
     - docker build -t imjenkins:v1 .

    then launch container
    -v /var/run/docker.sock:/var/run/docker.sock is used to communicate to the docker daemon from            within a container
    
     
     At https://hostIP:8084
    
     

     


     job1: it will fetch data from github and copy it to the local machine.

     



job2 : this job will run the docker container respective to the type of code given



 job3: this job will check if site is running properly and will send email in case it fails.
    



  job4 Testing: sending email on developer on app fail.
 

 job5: monitoring


 Pipeline:










 



Comments