Going from a project plan to a released product is a difficult journey. Continuous Delivery Process is a design practice used to automate and improve software delivery. Some of its principles are:
- every commit into the VCS can result in a release
- automate everything
- automated tests are essential
- done means released
The pipeline defines the quality gates that let the process continue with the next step. It consists of the following stages: the commit stage, the acceptance stage, UAT stage and production stage.We also need to use the right tools. As a project build automation tool we use Gradle, a build framework implemented in Groovy (a JVM language that runs on top of Java). Due to its flexibility and effectiveness, Gradle has already been chosen by some of the biggest names in the Java software space, including the Spring Framework and the Android Framework.
It is very important to automate most of the steps and we need a tool that will take hold of the pipeline and run each of the steps from compiling the source code, to deploying, to production. Jenkins is probably the most used continuous integration server in the Java space (and beyond). We use it to control and run our pipeline. Jenkins also has the concept of jobs.
One other important thing is that each time we start the pipeline chain of jobs we will assign a unique build number that will identify that particular run. In case the pipeline completes, the artifacts that will be produced will be identified by this unique number. In order to better visualize the pipeline we will use the build pipeline plugin that will enable a special dashboard where we can inspect all builds and drill into any of the steps in order to get more information.
One of the most overlooked features of a release is code quality. We always have to keep in mind that the lifespan of a software product doesn’t stop after the first release and that bug fixing and maintenance of a code base will eventually stretch over a greater timespan than the one used to develop the product in the first place.
Another important metric we have to monitor is code coverage. All these metrics should be calculated automatically after each commit, and this is where SonarQube comes into play. It is an open platform that manages code quality and it works with over 20 programming languages and out of the box with Java.
The next step in our pipeline is the creation of deployment artifacts. For Java projects these artifacts could be jar files, war files, ear files or even a combination of them. Artifactory is a tool known as a repository manager that was built to handle all of the above concerns and even some extra ones – it can also be used as a mirror for any public repository, or as a private company repository. As alternatives to Artifactory we can use Nexus or Archiva.
Bottom line: Continuous Delivery enhances software quality, it saves a lot of time and provides risk management benefits, like finding bugs early on and being able to guarantee delivery dates. It also reduces the work load of developers.
To find out more on how we can put Continous Delivery practices to use for you, request a call from one of our experts!