Basic Example to explain the Workflow of DevOps using webserver
#devops #linuxworld #jenkins #docker #webserver #rhel #redhat #vimaldaga #workflow #automation #ci #cd

Basic Example to explain the Workflow of DevOps using webserver

In companies, three different teams are working in parallel to push the application into the production world, so that their clients can make use of it.

These 3 teams include Developers, Testing, and Operation team. And due to the difference in their working environment and tools they use to work on creates a wall in between them. That wall is called Silos.

To overcome these silos, a kind of culture is being made typically called the DevOps, where these 3 teams work combined without any hurdle continuously. That provides agility and faster development of the application to their client

Deploying the website on the apache docker container creating a pipeline through Jenkins

Process for this example would be:

  1. Create a git repository and develop a Jenkins job that will fetch from the dev branch on every update
  2. On every update launch a live httpd container for the testing environment
  3. Jenkins will test the website running in the test environment. If it passes the test, dev branch will be merged to the master branch, and application/website is being deployed in a separate production environment

To accomplish this example, the process I have followed is creating two different pipelines. As one for launching container/application into the testing environment and another for testing and finally deploying into the production environment

Phase-1:

No alt text provided for this image

This phase includes two jobs as a) Pulling the code from the Github b) Launching the application in the testing environment.

Job-1

This job is responsible for pulling the code from the dev branch plus performing copying files into a different location so that this space gets cleaned after use.

No alt text provided for this image

Build Section:

rm -rf /task-1/
cp -rvf * /task-1/

Job-2:

For this job, the hierarchy of the code on Github should include Dockerfile and other source code files at the same location as,

No alt text provided for this image

Using this approach we can create the docker image for our application live from scratch.

This job would be Downstream for the previous job of pulling the code from Github.

No alt text provided for this image
No alt text provided for this image

In the building part, whenever the code is updated in the Github, a new docker image is being created and used for deploying the application.

Phase-2

No alt text provided for this image

This phase includes 3 jobs as, a) testing the code or the application deployed in the testing environment by running some test b) Merging the code into the master branch c) Deploying the application into the production environment

Job-1

This job includes some tests that are usually done by the testing either through running some test scripts or other means. In this post, I have just used the status of the web page as it would be accessible.

No alt text provided for this image

Job-2

In this Job, we will merge the dev branch to the master branch so that it could be finally deployed in the production environment.

No alt text provided for this image
No alt text provided for this image

First, we enter the Github repository URL as we do for pulling the code along with the credentials which are required to merge the code back to the master branch.

Then, for merging we use the post-build actions

Job-3

This job is similar to job-2 in the phase-1, as where we deployed the application in the testing environment. Here we will deploy it on the production environment.

No alt text provided for this image

For reference to the Github code: Github Link

If you have any doubts, then drop me a message. I will definitely try to revert you back.

Thank you.

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

Kritik Sachdeva的更多文章

  • Cephadm | Part-1

    Cephadm | Part-1

    In this small article, I will be covering a one of most of important component and critical component of ceph "cephadm"…

    3 条评论
  • Kubernetes Custom Controller Part-2

    Kubernetes Custom Controller Part-2

    This is a second blog of a two part series for the custom k8s controller. If you have no idea or knowledge about the…

  • Kubernetes Custom Controllers part-1

    Kubernetes Custom Controllers part-1

    What is a Controller? And what is a custom controller? Controller is an application or feature in k8s that looks up for…

    6 条评论
  • Deep dive into Ceph Scrubbing

    Deep dive into Ceph Scrubbing

    Definition Scrubbing is a mechanism in Ceph to maintain data integrity, similar to fsck in the file system, that will…

    13 条评论
  • "Ceph" a new era in the Storage world Part-1

    "Ceph" a new era in the Storage world Part-1

    Ceph is a Software Defined Storage solution created by Sage Weil in 2003 as part of his Ph.D project in California.

    6 条评论
  • Integration of Iscsi Storage with openshift | Part-2

    Integration of Iscsi Storage with openshift | Part-2

    Hi guys, in this post I will cover the iscsi server setup and how to automate it with ansible and use cases of…

    1 条评论
  • Configure HA Cluster on top of AWS using terraform and ansible

    Configure HA Cluster on top of AWS using terraform and ansible

    In this post, I will cover only the setting up of the HA cluster, not the resource creation part. So let's start with…

  • Storage Integration with Openshift

    Storage Integration with Openshift

    In this post, I am gonna show you how to integrate some of the storage solutions with openshift. And for the…

  • Podman vs Docker deploying a WordPress application

    Podman vs Docker deploying a WordPress application

    Container technology is the most popular tool used widely for the faster deployment of the application on to servers…

  • Amazon Kubernetes as a Service

    Amazon Kubernetes as a Service

    Why we need Aws to run our Kubernetes? What is Kubernetes? and so on..

    2 条评论

社区洞察

其他会员也浏览了