First task of Devops assembly line Training
Hritick Goyal
Data Engineer @ Jio | Immediate Joiner l Serving Notice Period | Microsoft azure data engineer associate DP203
I have just completed my first task in devops assembly line training under Vimal Daga sir.
The task was to create end to end automation from developer environment to production environment using jenkins tool.
It was divided into three jobs as job1, job 2 and job3.
Full description of each job with approach :
Job1: If Developer push to dev branch then jenkins will fetch from dev and deploy on dev-docker environment
Approach: For this job first I created my local repository on git and made one more branch in it using git branch and named it devop1. After that I created one hook for pushing file automatically on github using post-commit. So now whenever developer commit file in commit area it is automatically pushed to github, similarly I create one repository on github. After that I created a job on jenkins where I used poll scm and scheduled it to check github continuously for any change in devop1 branch and if any change happens, download that file into jenkins workspace. And within same job I have launched one docker container by using httpd image for my testing Environment and copy all the files from jenkins workspace to testing env.
Job2: If Developer push to master branch then Jenkins will fetch from master and deploy on master-docker environment.Both dev-docker and master-docker environment are on different docker containers.
Approach: For this job I have create a job in jenkins and launch one more docker container using same httpd image for my production environment and also expose that container for accessing it by client using ip for exposing, I used patting of port. After that I used pollscm for checking github for any change and if any change happened then download that file and copy to production env.and last thing I did was to trigger this job after completion of my job3 for this I made this job as downstream.
Job 3 :Manually the QA team will check (test) for the website running in dev-docker environment. If it is running fine then Jenkins will merge the dev branch to master branch and trigger #job 2
Approach: For this job first create a job in jenkins then configure my source code management by giving my github account link and credentials of github account and in branch to build gave my branch name ie devop 1. After that click on additional behaviour and select merge before build and give my repo name as origin ,branch to merge to as master and mode of merging as fast forward .Now I configured post build action in that select push only if build succeeds and add my branch as well. One last modification I have done was to run (build) this job using trigger remotely. and use the link generated by this as email notification because this job was for Quality Assurance team and run only when testing env running without error for this I have used email verification and will generate after my job 1 complete. So when QAT team receive that email having the link then only they build this job. and when this job is complete then only job2 will run for that i have already made job2 as downstream.
Thanks for reading this I hope I was able to explain it well.
Thanks to Vimal sir for giving me this task.