vivin / gradle-semantic-build-versioning

Gradle plugin to generate version-numbers and tags using semantic versioning
MIT License
85 stars 32 forks source link

Weird behavior invoking printVersion #88

Closed miguefl closed 6 years ago

miguefl commented 6 years ago

Hello, i'm using your gradle plugin in a project with Circle CI 2.0 integration and I'm getting weird results.

First of all, I've a problem with ssh connection and task tag --push. Git works but the plugin doesn't. I've the ssh private key added to ssh keystore.

#!/bin/bash -eo pipefail
./gradlew tag -Prelease --push
Picked up _JAVA_OPTIONS: -Xms512m -Xmx2048m
:tag FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':tag'.
> org.eclipse.jgit.api.errors.TransportException: git@github.com:repositoryName.git: push not permitted

So, I've changed the task invokation to

./gradlew -Prelease printVersion -q | awk '{print "v"$1}' | xargs git tag
git push origin --tags

And I get:

#!/bin/bash -eo pipefail
./gradlew -Prelease printVersion -q | awk '{print "v"$1}'
Picked up _JAVA_OPTIONS: -Xms512m -Xmx2048m
vCleaned
vCleaned
vCleaned
vCleaned
v1.0.1

So i've change to:

./gradlew -Prelease printVersion -q | awk '{print "v"$1}' | xargs -n 1 git tag
git push origin --tags

To get the last message, the version number.

Do you know why i'm getting those "Cleaned" messages?

Thanks !!

vivin commented 6 years ago

Not sure. I notice the loglevel is QUIET so perhaps it's picking up some other log messages?

miguefl commented 6 years ago

Yes, it has to be something like this. I'll try to figure out it.

Thanks !