Background: In our organization, we have multiple web apps and five servers in the cloud for each individual app. So whenever a developer added a new feature, the DevOps Team needed to do a release on all servers. Our five servers run behind an AWS Application Load Balancer. We first Deploy the application on one server and after final testing, deployment happens on all of the remaining servers. The main challenge is that when the developer confirms to start a release, we first need to deregister the server from the Application Load Balancer, then do the respective deployment, and then register the server to the load balancer again.
Performing this task for all servers consumes a lot of time and we knew automation was the solution. We created Jenkins Job to build and release the application to the individual server but we need some end-to-end automation program to make this happen.
Goals: Automating long software development processes and transitioning to a single-click action for production.
Goals: Automating long software development processes and transitioning to a single-click action for production.
Jenkins just saved 3 to 4 hours of being stuck in the deployment process. It also saved lots of energy, which we can use to make our infrastructure more reliable for customers.
Solution & Results: To meet this needed a combination of Jenkins, Groovy Scripts, and Bash Scripts to automate our complete process as a Pipeline. We installed AWS Command Line Interface in our Jenkins server. Then we created one master script in which we have functions to register and deregister the servers from the AWS Cloud Application Load Balancer.
We then created two Jenkins jobs to register and deregister the server from the application load balancer. In these jobs, we have called 'function' from the master script and created a parameterized job where the server name was selected automatically. We already have the job to deploy the application on individual servers.
The final task is to create a pipeline job which will first trigger the deregister job and then trigger the deployment job followed by the register job. We do the same for all servers. So we now have four Jenkins Jobs where the pipeline job will trigger all jobs as needed to automate the deployment on all five servers.
What did we learn?
Results include: