TASK 1 COMPLETE INTEGRATION OF JENKINS WITH GITHUB
Ankit Kumar
DevOps| Terraform | Linux |Azure | Azure DevOps | AWS | RH294( Ansible) | Python | Docker | Kubernetes | Grafana | ELK | Prometheus
Task Description
TASK 1 JOB#1 If Developer push to dev branch then Jenkins will fetch from dev and deploy on the dev-docker environment.
JOB#2 If Developer push to master branch then Jenkins will fetch from master and deploy on master-docker environment. both dev-docker and master-docker environments are on different docker containers.
JOB#3 Manually the QA team will check (test) for the website running in the docker environment. If it is running fine then Jenkins will merge the dev branch to master branch and trigger #job 2
STEP BY STEP EXPLANATION
JOB1
As the job1 tells we have to pull the code from dev branch GitHub and this task is done by Jenkins. it uses remote trigger to pull the code from Github.
After it triggers the code, then it will launch one container and at the time of launching the container, we mount the file where we put all the web hosting pages.
Once the job 1 runs successfully, it launches one container name as testing in the Redhat 8.1.
NEXT STEP
After we deploy the code the in the testing environment, it time to check whether it is running properly or not.
As you see in the picture, the command running in the Execute Shell, it will check your code, either it is right or not. This job will trigger once job1 runs successfully.
Understanding the Further step
Before understanding Job2, let us see the first Job3 because it gives a more better understanding about the task.
JOB 3
After the job 1 run and the code is tested by the Quality Assurance Team, then the developer branch code merges with the master branch, and this merge is done by Jenkins.
This job run after the QA team gives a green signal.
JOB2
Once the merge is done. job2 will trigger and it launches one production environment and in this environment, web pages after the, it become available to the client. This job is the as the job1 but the main difference is the webpages come after it merges with the branch.
So the whole setup is done and all your job runs successfully.
To put the code/push the code on the GitHub we use git. In this task also I use git and also use git property to hooks so that once you commit, it auto-trigger pushes to the respective branch.
In this task, have integrated git, gitbash, , Jenkins, REDHAT8.1, docker.
Thanks for giving your valuable time ..!
GOOD DAY!!?