Their would be 3 job performed:-
If Developer push to dev branch then Jenkins will fetch from dev and deploy on dev-docker environment.
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.
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 Now Start the automation:-
- First create git repository:-
- Create Dev and Master Branch
--> create hook to connect gitbash to github for pull the cade by jenkins.

-->Configure job in jenkins to fetch from dev:-

--> After that fetch dev branch in dev docker environment.

Execute shell part :- sudo cp -rvf index.html /root/devfile if sudo docker ps | grep devenv then echo “already running” else sudo docker run -dit -p 8083:80 -v /root/devfile:/usr/local/apache2/hotdocs — name devenv httpd fi
Execute shell part:-sudo cp -rvf index.html /root/masterfile if sudo docker ps | grep masterfile then echo “already running” else sudo docker run -dit -p 8085:80 -v /root/masterfile:/usr/local/apache2/hotdocs — name masterenv httpd fi
Yashmit Sharma





