Setting up testing and production environment using Git, Docker and jenkins

Basically it's a DevOps project.

In this article, I'll talk about two environments i.e. testing and production environment.

Why we require these two environments?

In real world scenario, developer writes and code and commits it to (Testing environment) Git. And if the code of testing environment succeeded with no bugs, then the code gets pushed to Production system.

Tools used :

  1. GIT --> For setting up two branches master and developer branch, webhooks, code pushing.
  2. Docker --> For launching two different systems i.e. production and testing env.
  3. Jenkins --> For triggering and automating the workflow.

So, make a Git repository and clone it to your local system.

Now, setting up the job1 in jenkins

No alt text provided for this image


Now build the triggers i.e. launching docker containers of production.

No alt text provided for this image

Now, for job2

No alt text provided for this image

Now build the triggers i.e. launching docker containers of testing.

No alt text provided for this image

Adding the Git configuration in jenkins(Job3)

No alt text provided for this image

Now adding up the post build action for GIT.

No alt text provided for this image

Adding up the webhooks in GITHUB, use your ngrok Payload URL.

No alt text provided for this image

Now, finally our system environment is ready to test. Make some changes in your git repository. Add > Commit > push.

No alt text provided for this image

So, here we go as soon as we push our changes in GIT our job1 will get triggered, and we can see live changes in our website or code.

Thanks for reading this article.

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

Gaurav B.的更多文章

社区洞察

其他会员也浏览了