Automating Jenkins with Docker and Github

The task 2 given by Vimal Sir finally gets completed.

This task was a task which took my learning to another level.

In Step 1 , I created a Dockerfile with jenkins ready in it such that as container launches , jenkins should automatically start.

This setup was challenging as we had no systemctl command to start jenkins , then how to start jenkins.

So going inside the file which starts when jenkins start in the baseOS , seeing that and implementing the same in Docker.

In step 2 , in the Jenkins , we had to create 5 jobs :

Job 1 : In this , I configured my jenkins to automatically pull the code pushed by the developer.

Job 2 : In this , I created different containers with different interpreters. Then gave Jenkins the power to launch those language specific containers by detecting the type of code from their extensions.

Now how to run docker from jenkins running inside docker , well this will be done by using ssh connectivity (the thing which required too much trouble and help to find) 

Job 3 : In this , I deployed the code on my container and tested it using curl and exit combination to see if it executed without any error or not.

Job 4 : If it did not run properly , in this job Jenkins emailed it to the developer using the code stored in OS along with the code initially.

Job 5 : Monitored my container for failure and restarted on receiving errors

要查看或添加评论,请登录

Jyotirmaya Vasaniwal的更多文章

社区洞察

其他会员也浏览了