Setting up testing environment using Docker + Jenkins + Github
Sandeep Singh Rajawat
Former Business Technology Solutions Associate @ ZS Associate
In an Organization When multiple developers are working on code or project its very essential that it has to be tested in a testing environment meeting all requirement before deploying it to the production phase. For that we can first test our code on one testing environment and only after testing pass we can merge our work with our main code . For these tasks I have created , built multiple jobs in Jenkins in order to automate the process.
JOB 1
After pushing dev branch data from git to github . Jenkins will automatically take the code from github dev branch and deploy into dev docker container . For that I first link the job1 with source code management tool - github repo and link the job1 with dev branch.
After that in build execute I have fetch the code and then deploy a dev testing container with the code.
I made this job to run after every 1 minute so that everytime the code uploaded on github it will This job has to run periodically i.e. every minute in order to fetch the upload code from github.
JOB 2
Job 2 will be same as job 1 but master and dev branch code will be on different docker containers.
JOB 3
Now when we check the website of dev branch code . if its working fine that means our testing is good and we can merge the master and dev branch work for that for that i add credentials with git repositary url and merge the dev branch code to our main work that is master environment.
And at last , build all three jobs and then testing environment will be set up with integrated tools using docker + Jenkins + Github.
Business Technology Solutions Associate Consultant @ ZS Pune
4 年Great work!