overexchange
overexchange

Reputation: 1

Versioning of artifacts - CI/CD

Build process of java code is currently generating artifacts with name having no version number.

For ex: serial-framework-SNAPSHOT.jar

We are currently in build phase of CI/CD pipeline

All the artifacts generated through maven build has no version number for back-end services, in build phase of CI/CD pipeline

Dependent artifacts that are required to build a specific jar are only stored in JFrog artifactory


1) Does it require versioning of artifacts for Build/QA/prod phase of CI/CD pipeline?

2) Does it require to store every artifact in JFrog artifactory? Because only dependent artifacts that are required by pom.xml during maven build are stored in JFrog

Upvotes: 0

Views: 3350

Answers (2)

Sahit
Sahit

Reputation: 510

The versioning was well explained in the first answer by snukone.Note the below points which might be helpful regarding versioning

For development always follow the version as “versionNumber-SNAPSHOT “(capital letters) Eg:- 1.0 -SNAPSHOT

2) For test/prod branch follow the version as “versionNumber-RELEASE” Eg:- 1.0 – RELEASE

a) Snapshots are mutable, so they are used for development purpose.

b) Releases are immutable. Once committed we cannot override the artifact in the artifactory. So releases are used for higher environments.

c) Snapshots capture a work in progress and are used during development. A Snapshot artifact has both a version number such as “1.3.0” or “1.3” and a timestamp. For example, a snapshot artifact for commons-lang 1.3.0 might have the name commons-lang-1.3.0-20090314.182342-1.jar

So in your case if you are using "serial-framework-SNAPSHOT" it will store as "serial-framework-version-timestamp.jar" in your artifactory.

Similarly if you are using "serial-framework-RELEASE" it will store as "serial-framework-version.jar" in your artifactory.

Upvotes: 2

snukone
snukone

Reputation: 322

How versioning helps:

  • Versioning helps in case you want to restore an older version of your application (due to bugs that are heavily decreasing performance in production)
  • If you are running integrationtests on api or ui level, you can specify which versions are fitting together (ie via contract testing: https://github.com/pact-foundation/pact_broker)
  • Default cleaning processes helps you to prevent your artifactory from huge storage usage

Storing every artifact or not?

My personal experience: Just store the artifacts which are dependencies to other artifacts. Like Libs for example. If you are working with Docker Container you should think about to version the Docker images which you are producing on every build.

Upvotes: 1

Related Questions