Thursday, May 7, 2020

Jenkins Integration With Docker And Github


Today I built an automated system. Basically, I integrate lots of technologies: Git, Github, Jenkins, docker.

Agenda!!!
I build a small pipeline so that whenever the developer writes their code on our laptop on the Git so after they commit it automatically goes to Github and whenever Github updates any code so it automatically deploys on the website and also I create a testing environment same as the production environment.so whenever new developers write their code and upload on Github. so the first testing team checks its correct or if it's working good so a trigger is run and the code is upload on the production environment.

First, we write some code in git and commit.
Also, we create post-hooks so to push automatically when we do commit in git.



So our code goes to GitHub. And then Jenkins's work starts when something is upload on GitHub so Jenkins automatically downloads that code and starts a new os for the webserver. They create this environment with the help of a docker container. So they launch the new os in just 1 sec.

code


Here we know our developers also work behind to improve our performance and more user-friendly build the things. So they work behind the scene. For this, they make one more branch in git.


code


 And write the code there and after complete, they send it to the code to the testing environment for checking it works properly or not. For this we first as above I made a hook earlier so when I commit so it pushes automatically on the GitHub and when GitHub update with code on our system so then Jenkins work again start they create one more environment exactly same as the production environment. And it's good practice to make every time a new environment when you test the code so I made this code.

Caution:  Make sure if you use this code below so don't use both codes on the same system.


code


So after that, a quality assurance team will check this and after that, they feel it's good so it clicks a link it works as a trigger so that Jenkins will merge both the branches.


code



That's all...
Hereafter they automatically merge and update in the main production server.


code


code



I will come back with a new task stay tunned with me 

Thank you for reading...

No comments:

Post a Comment