Task -1 DevOps

Task -1 DevOps


MY TASK OVERVIEW

JOB-1

  • If Developer pushes to dev branch then Jenkins will fetch from dev and deploy on the dev-docker environment.

JOB-2

  • If Developer pushes 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.

JOB-3

  • Manually the QA team will check (test) for the website running in the dev-docker environment. If it is running fine then Jenkins will merge the dev branch to the master branch and trigger #job 2.

Basic tools required

  • Redhat-8 Linux Enterprise
  • Docker
  • Github
  • Jenkins

Getting start my project

First, you created my own HTTPD Image by using Dockerfile so that you can use it in my project.

My DockerFile

FROM centos
RUN yum install java-11-openjdk.x86_64 -y
RUN yum install git httpd -y
EXPOSE 80
CMD  /usr/sbin/httpd  -DFOREGROUND

Name of Image:- httpd:v1

JOB-1

you have a repository in which one is a developer branch code and another one is the master branch code. The Master branch have one HTML file named as master.html and the developer branch have code named as dev.html



My Job-1 name is dev-docker-environment and I set the URL of GitHub repo and branch dev1.



I used Poll SCM build Trigger so Jenkins each time go to Github and check if any code updated in the dev1 branch then it pulls code and deploy into the dev-docker-environment for testing purpose and also expose it with port no. 8081.

JOB-2

My Job-2 name is master-docker-environment and I used the same configuration as Job-1. But the only difference is that Jenkins Deploy master branch code into the production environment and expose it with port no. 8082.

I used Build after other projects are build trigger as well as PollSCM into Job-2. This Job run can run two ways if Job-3 is stable and also if some changed done directly into the master branch (production system). What is the purpose of using this triggered ?? You will understand clearly in further explanation.

Code is successfully deployed by Jenkins into docker environment

The output of Job-1 and Job-2 into Redhat-8 VM where Docker is running.

Job-3

This Job is manually checked by the QA team if the website running properly in the dev-docker environment then Jenkins will merge the dev branch code into the master branch code and also triggered Job-2, so that is the reason why I set one more triggered inside Job2.

Setup the environment of Job-3


So it was all about How to set up the environment of Job-1, Job-2, and Job-3. Let's run all Jobs one by one.


Job-1 Output, when I uploaded code into dev1 branch on Github


Job-2 Output, when I uploaded code into the master branch directly on GitHub but in the real world, we rarely put our code directly into the production environment.


Job-3 Output, when Job-1 successfully deployed and working fine then merging the dev1 brach code into the production system (master-docker-environment).

testing after dev1 branch Code is deployed into master branch which has IP 172.17.0.3

This explanation was all about my project. Hope you liked my project and my efford


Thank you for giving your time !.................





要查看或添加评论,请登录

Priyanshu Pathak的更多文章

  • Integration of Jenkins, Docker, Git and httpd

    Integration of Jenkins, Docker, Git and httpd

    1. Create container image that’s has Jenkins installed using dockerfile.

  • Task -6 Hybrid Multi-Cloud

    Task -6 Hybrid Multi-Cloud

    TASK 1. Write an Infrastructure as code using Terraform, which automatically deploy the WordPress application 2.

  • Task 4 Hybrid Multi-Cloud

    Task 4 Hybrid Multi-Cloud

    In this article, we are going to host a WordPress application on AWS in a secure manner. A WordPress application…

  • Task 3

    Task 3

    In this article, we are going to host a WordPress application on AWS in a secure manner. A WordPress application…

  • Task-2 Hybrid Multi-Cloud

    Task-2 Hybrid Multi-Cloud

    In this article, we are going to see how we can host an apache webserver using AWS EC2 and EFS services. Our site will…

  • Task 1 - Hybrid Multi-Cloud

    Task 1 - Hybrid Multi-Cloud

    This task is to give by mr.vimal Daga sir.

社区洞察

其他会员也浏览了