Background: There were many different and repetitive tasks in my organization that could be automated to provide better and faster solutions for clients. Challenges like the Product team needing images to upload on AWS S3 bucket and needing the public URL of the image. This is done by the DevOps team at my company, which takes a lot of time and distracts them. So I have automated these tasks using Jenkins and bash scripting which has saved me as much as ten times the effort.
More regular tasks were automated like Running Mongo/MySQL queries, automating pipeline for the deployment of Containers, Pods, and Production servers. Also, the need to set up the complete environment for Staging, Pre-production, and Production servers. It was very challenging for us to set up, but Jenkins has really given us a way to make it much easier, simpler, and reliable.
Goals: Automate day-to-day manual tasks and save time
Solution & Results: There were mainly 3 - 4 challenges that I have solved using Jenkins. We need to upload images on the AWS S3 bucket manually. Using Jenkins Plugins for AWS and bash scripting, I have created one job that anyone can use with no prior knowledge of AWS. This job will take Images as a parameter, and the image will be uploaded. It will give output as a public URL of that image, that is also uploaded. This same job can also make automated backups of different Files from the local server to S3 storage on AWS.
Jenkins was kind of a revolution in my career. After learning and implementing Jenkins use cases in my organization, it increased my value to my company.
Another is creating the complete infrastructure pipeline for creating pre-production Environment to Production Environment and Deploying Code to testing and production. The entire scenario was to first create a new branch in git for a new developer or task and module. After creating the branch, the code will be automatically pushed to GitHub right after committing the code. After pushing to GitHub, a job will be triggered automatically to fetch that code from GitHub and deploy it to the Testing Environment.
The Environment Automated Testing job will be sequenced downstream, and automated testing will be completed. Here if the test fails, it will automatically trigger the Jenkins job for contacting that developer. If the testing is successful, it will trigger the job to merge the new branch to the master branch of git. And when the master branch on Github gets the latest code, it will automatically trigger the job, which will directly fetch the code from GitHub and deploy it to the production Servers on container/EC2 instances or Kubernetes.
This complete pipeline solution can only be possible because of the flexibility of Jenkins. The whole project relies on:
The results are as follows: