Maven and Docker Builds, Releases and Deploy on Kubernetes/OpenShift

1/11/2019

I'm struggling with the conception of a sensible tagging/naming convention for my project. I would definitely like to use semantic versioning, i.e. tagging the production image as x.y.z, where x is the major, y is the minor and z is the patch version.

Overall, I have three stages: DEV, QA and PROD. The process is as follows:

  1. A commit is pushed to a remote feature/patch branch, which is branched from master
  2. The build verifier is started and runs several tests
  3. A code review is done by another developer
  4. The branch is merged into master
  5. The build pipeline is started and a maven and a docker image is built
  6. The docker image is deployed to DEV
  7. The image, which runs flawlessly on DEV is deployed to QA
  8. If QA approves, the image is deployed to PROD.

What I need now is a strategy, how I can achieve a semantic versioning with labels. Initially our Maven pom has the version 1.0.0-SNAPSHOT and the maven-docker-plugin replaces that with the label latest before tagging the Docker image. What I would like for my first PROD image is the tag 1.0.0. What is the suggestion for the version number of the QA image? 1.0.0-RC? I guess, it would be best, if I build the the image only once - before deploying to DEV - and subsequently only tag and deploy it to the remaining two stages?

Overall: is or should there be a difference in versioning between the Maven and the Docker image?

Thanks in advance!

-- IceThunder
docker
git
kubernetes
maven
openshift

0 Answers