overexchange
overexchange

Reputation: 1

When to create a branch from tag?

For a specific project, we are not planning for release

Using CI/CD approach, Dev pipeline is creating artifacts with name convention , something like: 1.0-23-SNAPSHOT.jar.

We cannot create release branch from develop branch, to trigger QA pipeline, because there is no release, for this application, sooner.

Goal is to start QA phase.

QA pipeline need to be triggered on specific tagged commit on develop branch but create artifact something like: ${future_release_num}-${git_tag}-release.jar

Source code build process generate the artifacts with such naming convention. Some dependent artifacts are placed by maven build in JFrog, so that they are pulled by pom.xml during maven build.

Developers are continuously working in develop branch.


Does branching from tagged commit resolve this problem? to trigger QA pipeline... We basically want to create this branch just for artifact naming convention

Upvotes: 1

Views: 245

Answers (1)

Deck
Deck

Reputation: 1979

In order to create a branch from a tag you can have

git checkout -b <branch_name_you_want_to_create> <tag>

However, I would recommend to place functionality generating an artefact name to the CI so you don't pollute your repository with many custom branch names. Instead, you can generate a name based on given SHA.

You can get the closes tag using:

git describe --abbrev=0

But still, the CI should know what you are going to release. It can be major version, minor or patch (provided you use semver at all).

Upvotes: 1

Related Questions