MLOPS TASK 1
So in this task we are going to do following:
- JOB1: If developer push the code to the dev branch then Jenkins will fetch from dev and deploy on dev-docker environment.
- JOB2: If developer push the code to the master branch then Jenkins will fetch the code from master and deploy on the master-docker environment.
- JOB3: Manually the QA team will check ( test ) for the website running in the dev-docker environment . If it is running fine then Jenkins will merge the dev branch to the master branch and trigger the JOB2.
JOB1:
So here in this job we are going to create the developer environment and push the code to the developer branch on the GitHub by using the Git Bash tool.
So this is the code that we are going to push into the github repository.
So here I have pushed the code to the GitHub branch after committing.
After that when the code is pushed to the GitHub then the Jenkins will automatically deploy the code on the developer-docker environment.
JOB2:
So here in this job we are going to create the master environment and push the code to the master branch on the GitHub by using the Git Bash tool.
So this is the code that we are going to push into the github repository.
So here I have pushed the code to the GitHub branch after committing.
After that when the code is pushed to the GitHub then the Jenkins will automatically deploy the code on the master-docker environment.
JOB3:
Now in this JOB we are going to merge the code from the dev branch to the master branch if the testing of the dev branch is successful , else merge does not occurs.
So first we manually check that webpage deployed on the dev-docker environment is successfully working or not.
So here finally I have actually run this job after the JOB1, which is after the dev environment. So in this job it will check that the dev-docker container is running or not , if it is running then it will check the httpd_code. After returning the code if it is equal to 200, then it means that the site is working good.
So after that i have given the command to checkout to master and merge the code with the dev branch . Else exit .
After that in the post-build I have given the JOB2 to run , so that the master webpage can also be updated.
Hence the task is completed