Background: Our IT team set out to develop a long-term deployment strategy for our CI/CD pipeline. Before Jenkins, it was very tricky to use Blue-Green deployment on dynamic content, which changes frequently. Although they could swap the slots to use production or UAT, the data synchronization and maintaining stateful content was very challenging.
Goals: To develop and deploy a full stack application using Jenkins CI/CD pipeline.
Solution & Results:
Jenkins allows our teams to build applications across platforms continuously. The Azure pipeline includes the ability to create any application on any platform, including Windows, Linux, and Mac. However, it also integrates well with Jenkins for teams who already use or prefer to use Jenkins for CI.
Jenkins is a very popular Java-based, open-source, continuous integration (CI) server that allows teams to continuously build applications across platforms.
As our release pipeline is very much integrated, we chose to use docker images once we complete the CI build we store in our private repository, Artifactory. We then push the image to trigger the development instance. Once the development instance is verified, we can trigger the UAT instance for testing. Once UAT is signed off, we release the same in production. In this way, we ensure that the same image is verified with different configs, i.e., test, UAT, and prod config. If the production fails, we can quickly rollback by releasing the last successful production. Since it only takes five to ten minutes, we can ensure that there is hardly any downtime if production fails due to some reason.
This is what we used to integrate Jenkins with Azure pipelines:
One way is to run CI jobs in Jenkins separately. This involves configuring a CI pipeline in Jenkins and a webhook in Azure DevOps that invokes the CI process when source code is pushed to a repository or branch.
Create an Azure DevOps Build Pipeline for Jenkins.
Create a Personal Access Token for connecting Jenkins and Azure DevOps. Then set up a Jenkins Build Project. Test the Jenkins Build. Set up an Azure DevOps pipeline release. Trigger the release with a Post Build Action in Jenkins.
We have used the following plugins.
I am happy that I have used Azure DevOps with Jenkins and, in doing so, learned many new concepts. I am even more satisfied with the results: