In real-world use cases, it's a standard practice to treat development, test, and production systems differently because they have differing security, data, and privacy controls. No code is deployed directly to be presented before the user, firstly it is tested in a testing environment and if it works fine, only then it is deployed in the production system.
About the project -
In this project, I have made 2 environments- one for testing and other for the production system. The code is pushed by the Developer to GitHub. The code is pulled into our system by a job of Jenkins and then it is tested in a Docker environment for its efficiency and working. If any changes or updates are needed to be done in the code, we do it in the testing environment. After successful testing, the code is deployed for the user.
Setup -
1) Jenkins
2) GitHub
3) Git Bash
4) REDHAT8 Linux - Docker
Jenkins Jobs -
Job 1 -
The developer pushes the code to GitHub. This job pulls it from there and copies to a Test directory. The branch we are in right now is the Test/Developer branch.
Job 2 -
This job launches a testing environment i.e. a Docker container. If the container is already running, it displayes a message.
Job 3 -
This job is for testing the code by getting the Status code. If the status code is 200, the testing is successful and it can be further deployed to the user. If status code is other than 200, testing has failed and we have to do changes/updates in the code.
Job 4 -
After successful testing, this job merges the Test branch with the Master branch.
Job 5 -
This job pulls and copies the tested code into a directory for deploying.
Job 6 -
This job launches a deploying environment to be presented before the user. If the Docker container environment is already running, it displays a message.
Comments
Post a Comment