Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-PversionIncrementer=incrementerPatch not working #764

Open
manideepla opened this issue May 28, 2024 · 2 comments
Open

-PversionIncrementer=incrementerPatch not working #764

manideepla opened this issue May 28, 2024 · 2 comments

Comments

@manideepla
Copy link

./gradlew --stacktrace release -Prelease.forceVersion=0.1.0 -Prelease.versionIncrementer=incrementPatch -Prelease.disableChecks -Prelease.pushTagsOnly

I'm using this command in a CI/CD pipeline on a repo that already has tags.

But the output is saying this:

> Task :release FAILED
Replacing pattern "version: 0.1.0" with "version: 0.1.0" in /azp/_work/1/s/README.md
Creating tag: basket-online-0.1.0

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':release'.
> org.eclipse.jgit.api.errors.RefAlreadyExistsException: tag 'Tag={
  object 836e8d53f9cd0a9a11070f82d238145d658f3c83
  type commit
  tag basket-online-0.1.0
  tagger PersonIdent[root, root@azdevops-scaledjob-wnw2s-tkds8, Tue May 28 14:30:24 2024 +0000]
  
  }' already exists

build.gradle configuration:

scmVersion {
    ignoreUncommittedChanges = false
    versionIncrementer 'incrementMinor'

    tag {
        prefix = 'basket-online'
        versionSeparator = '-'
    }
    nextVersion {
        suffix = 'SNAPSHOT'
        separator = '-'
    }

    hooks {
        //Not yet working
        pre 'fileUpdate', [file: 'README.md', pattern: { v, c -> /version: $v/ }, replacement: { v, c -> "version: $v" }]
        pre 'commit'
    }
}

Version is 1.13.6. Can you help please?

@manideepla
Copy link
Author

manideepla commented May 28, 2024

The same seems to be working for the markNextVersion command though

./gradlew -Prelease.forceVersion=0.1.0 -Prelease.incrementer=incrementPatch -Prelease.localOnly --stacktrace markNextVersion

Output

> Task :markNextVersion
Creating next version marker tag: basket-online-0.1.1-SNAPSHOT
Changes made to local repository only

@manideepla
Copy link
Author

One more observation is that the plugin seems to be printing 0.1.0 for gradlew currentVersion only when the latest commit does not have an associated tag. If the latest commit has a tag associated with it, it seems to be printing the version correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant