Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Jenkins not recognizing Tags? #736

Unanswered
Tim-Howard asked this question in Q&A
Discussion options

To all:

I'm trying to get commitizen to auto-increment in our Jenkins file when it is being pushed to our DEV environment.

In the Jenkins file I have tried both of the following commands:

 sh 'cz bump --no-verify'
 sh 'cz bump'

However in Jenkins, I'm seeing the following error (with both cz bump and cz bump --no-verify)

16:42:00 + cz bump
16:42:01 Tag v1.0.0 could not be found. 
16:42:01 Possible causes:
16:42:01 - version in configuration is not the current version
16:42:01 - tag_format is missing, check them using 'git tag --list'

However, when I check the tags it shows tha v1.0.0 exists.

(analytical-workspace-py3.8) C:\Python_Repository\analytical-workspace>git tag
v0.2.0
v1.0.0

The CHANGELOG.md file also appears to have the correct version:

## v1.0.0 (2023年05月03日)
### Feat
- Setting up Commitzen for auto-updating

As does the version number in my pyproject.toml file:

[tool.commitizen]
version = "1.0.0"
update_changelog_on_bump = true
check-consistency = true
allow-abort = false
name = "cz_conventional_commits"
tag_format = "v$major.$minor.$patch$prerelease"

Is there something I'm doing incorrectly that cz bump is not recognizing the tag that is there?

You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

What happens when you run sh"git tag" on your Jenkins? Also try on Jenkins sh"git branch" to check under which branch you are.

Normally you have to add "Advanced clone behaviors" to your pipeline configuration:

  • check out to local branch
  • fetch tags
You must be logged in to vote
3 replies
Comment options

I added sh 'git tag' and sh 'git branch' before the sh 'cz bump' statement

The sh 'git tag' returned nothing (which makes sense given the error message)

However the sh 'git branch' returned the correct branch

08:05:37 + git branch
08:05:37 * feature/PROS-63-automate-incrementation-of-analytical-workspace-versions 

So it seems that it recognizes the correct branch, but for some reason, doesn't recognize the tags that exist for that branch. Since it recognizes the correct branch, would I really need to check out to the local branch?

Comment options

woile May 4, 2023
Maintainer

If the branch is there, maybe you can skip the "checkout to local branch", but try the "fetch tags". The problem is not commitizen. It's your Jenkins which doesn't have the tags. I'm not able to help much further beyond that. Please let us know if you fix it

Comment options

Thanks. We're investigating our our side,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /