Continuous Integration of jenkins ,github and Docker(Task1)

What is Docker?

Abhishek Sharma

--

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.

What is jenkins?

Jenkins is an open source automation tool written in Java with plugins built for Continuous Integration purpose. Jenkins is used to build and test your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build.

What is Github?

GitHub, Inc. is a United States-based global company that provides hosting for software development and version control using Git. It is a subsidiary of Microsoft, which acquired the company in 2018 for US$7.5 billion. It offers the distributed version control and source code management (SCM) functionality of Git, plus its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project.

About the task..

JOB#1
If Developer push to dev branch then Jenkins will fetch from dev and deploy on dev-docker environment.

JOB#2
If Developer push to master branch then Jenkins will fetch from master and deploy on master-docke 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 dev-docker environment. If it is running fine then Jenkins will merge the dev branch to master branch and trigger job 2

Here the task begins…..

  1. First we have to create the git repositories.

We have created a GIT Repository without initializing it and created a sample html file for testing the setup then uploaded it on the git hub using the Git Push command.

We created the copy of the file in a Git Branch namely Dev for the development and testing.

2. Using of the Ngrok…

3. Launching of webserver.

We require a web server to launch the sample application we made, here we use the Apache HTTPD server using Docker httpd image.

Now login into the jenkins and do further process…..

Now we have to create the three jobs….

JOB-1

If the Developer push to Master Branch then Jenkins will fetch from master and deploy on prodOS container

JOB-2

If the Developer push to dev branch then jenkins will fetch from dev and deploy on the testOS container, for this you have to go to the configure of Job1

JOB-3

Now the OAT will check the test application in the test environment and if it passes the test then the jenkins will merge the dev branch to master branch and trigger Job 1.

If you go and Build/Run the job 3 will see this modified page which is made by merging the contents of both the master and branch of the repository.

That’s all about my task…..

Thank You……….

--

--