What is the proper strategy for running this inside GitLab CI/CD? #128
-
Having trouble coming up with a good solution here. When you push a tag to gitlab, it starts a tag pipeline. The tag pipeline a) has no associated branch, and b) uses a detached head. This means the Additionally, if I manually run Another option would be to stop using tag pipelines all-together. Instead, I run a pipeline on a merge or push to master. In this case I can be confident about the current branch, and let dynamic-versioning calculate the tag based on previous tag history. But this has the issue of not letting me simply tag a commit to create a release. I have to make sure the tag I want has already been created in history before the actual code changes are merged, it seems backwards and probably will lead to having to run multiple pipelines to get a proper release. Merge once to get the changes, manually tag the merge commit, then re-run the merge pipeline to actually trigger the versioning on that new tag. Definitely feels wonky. I have a feeling I'm just thinking about this wrong. Does anyone have experience with this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! Thanks for the detailed question.
I'm not as familiar with GitLab as I am with GitHub, but I think you could fix it with some combination of these GitLab settings:
It uses |
Beta Was this translation helpful? Give feedback.
Hi! Thanks for the detailed question.
I'm not as familiar with GitLab as I am with GitHub, but I think you could fix it with some combination of these GitLab settings:
GIT_DEPTH: 0
in thevariables
sectiongit checkout "$CI_COMMIT_REF_NAME"
in thebefore_script
sectionIt uses
HEAD
by default, and you can customize it with thetag-branch
option. Where are you seeing it default tomaster
?