How git tag can add more meaning to artifact name?

518 views Asked by At

Currently we give artifact name as releasenumber-sprintnumber-jenkinsbuildnumber-SNAPSHOT.jar

But we are planning to map every commit tag to the version of artifact generated from build.

So, artifact name will be releasenumber-gittag-SNAPSHOT.jar


So, To make it more helpful at build-QA-release phase of pipelines,

what should git tag look like, when developer tags the commit?

These artifact names will be part of build.gradle or pom.xml in java build as dependencies.

1

There are 1 answers

0
James Wilson On

I would be tempted to use the short sha from the git commit alongside the Jenkins build number. My reason is there are two parts to producing the same artefact:

  1. Building from the same version of the source code
  2. Building in the same environment with the same dependencies

On occasions I have seen a patch to the operating system on a build server cause a bug when re-building the same code. Therefore, by recording both the commit id (short sha from git) and the build id (build number from Jenkins) you can identify exactly where a build came from.