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 :
- GIT --> For setting up two branches master and developer branch, webhooks, code pushing.
- Docker --> For launching two different systems i.e. production and testing env.
- 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
Now build the triggers i.e. launching docker containers of production.
Now, for job2
Now build the triggers i.e. launching docker containers of testing.
Adding the Git configuration in jenkins(Job3)
Now adding up the post build action for GIT.
Adding up the webhooks in GITHUB, use your ngrok Payload URL.
Now, finally our system environment is ready to test. Make some changes in your git repository. Add > Commit > push.
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.