Integration of Github, Jenkins, and Docker
Integration of Github, Jenkins, and Docker
This is the first task i got in MLOps+DevOps training by LinuxWorld, India.
Why we need this project ?🤔🤔🤔
Ans: The industry now need automation in every field, here in this task we are doing the same , now Question arise HOW?🙄😶 for that we have used Jenkins , The popular automation tool which is used for various purposes but here we are using Jenkins to automate the process of whenever developer append to the code/program/app/file the jenkins will automatically upadtae the github repository, for this here we used three jobs😮…
what actually are those jobs ?😦🙂 this is the right question…
Ans: The first jobs is, If Developer push to dev branch then Jenkins will fetch from dev and deploy on dev-docker environment.
The Second One is ,If Developer push to master branch then Jenkins will fetch from master and deploy on master-docke environment.
Both dev-docker and master-docker environment are on different docker containers.
The Third job is ,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
So this was the description of the task now get to work >>>
Here i have done the task step by step :
Step 1 : I have created a Github repository as a public repository. for this you have to sign in https://github.com and click on new repository > name the repository > initialise with Readme.md(optional) > commit . Hurray🥳🥳🥳… your repository is ready now.
Step 2 : install Jenkins in your base OS and run commands to stert it , then open web browser and open the url https://localhost:8080 and you will land on the homepage of Jenkins and then you have to give admin password which is given to you on that location which is shown in homepage of Jenkins , go to that location and copy the admin password and paste it to password section on homepage , the you will be asked for reset password , set a memorable password it’s quite important because there is no forgot password option in Jenkins (may be it be there i haven’t seen yet), now you are ready to do the jobs 🥳🥳🥳🥳 (ignore this step if you have already installed Jenkins😎😎)
Step 3 : We have to clone the Repository in our local system for that we have to create a workspace ( the folder where we gonna work 🤗) Open that folder in terminal and run the command “git clone https://github.com/ashu-cybertron/mldevtask1.git”(you should give your Github repo. link) and then we have to run some commands to make a developer ,initialize the repository ,pull from repo. , push to repo. as shown in figures below…👇🏼👇🏼🙂
Step 4 : Here we have to push developer(dev1 ) branch data from git to github then , We need Jenkins to automatically take the code from Github developer branch and deploy into developer docker container . For that, we hatve to first link the [Job 1] with Github repository and link the [Job 1] with developer branch as shown in following figures …👇🏼👇🏼👇🏼👇🏼👇🏼
Here in 2nd picture we scheduled the job for each one minute and think what gonna happen , Magic …………… the job will be triggered every minute ,
here we done the MAGIC ehich automatically check the environment if web-server is not running then it will automatically run the whole environment in few seconds ……….!!!! Aabra ka daabra !!!! 😂😂😂😂
Job 2 begins : This job is not so magical , it is replica of fitst job but , Guess What??????????????????
Simple guys , Nothing special it is for Master branch ha ha ha….🤣🤣🤣 here the images right below 👇🏼👇🏼👇🏼👇🏼👇🏼
Step 5 : Here the job 3 starts , here it check the web-server of developer branch . if working fine, we conclude that our testing is going Great ✌✌✌ and now we are ready to merge the master and developer branch... for that we have added the repository link with id and password (credentials ) and merge the developer code to our master branch work
this will be done after above work done
here our work completes….🤗🤗🤗🤗
All thanks to #vimaldaga sir who taught so well to do this type of task ….
Comments
Post a Comment