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

Git tags are not automatically created on publishBintray #487

Open
johanhaleby opened this issue Sep 14, 2018 · 8 comments
Open

Git tags are not automatically created on publishBintray #487

johanhaleby opened this issue Sep 14, 2018 · 8 comments

Comments

@johanhaleby
Copy link

I have the following configuration:

autoGitTag {
    enabled = true
    annotated = true
    tag = "$version"
    message = "Released $version"
}

However when I run ./kobaltw assemble uploadBintray the git tagging step gives me the following error that I cannot understand:

Tag on repository without HEAD currently not supported

I've cloned the project from github as I do with all other projects so nothing special there. I also run the command from the root of the project and everything is in sync with the remote repository so I don't really understand why I get this error.

@cbeust
Copy link
Owner

cbeust commented Sep 14, 2018

Mmmh, this seems to be more of a git issue than Kobalt? Does your repo have a HEAD?

@johanhaleby
Copy link
Author

johanhaleby commented Sep 15, 2018

@cbeust It very well might but I don't understand what the problem is.

$ git branch -r
origin/HEAD -> origin/master
origin/master
$ git remote show origin
* remote origin
  Fetch URL: [email protected]:johanhaleby/kystrix.git
  Push  URL: [email protected]:johanhaleby/kystrix.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)

This seem to be the same settings I have for other projects such as Awaitility where git tagging seem to work (but they're using Maven).

So not quite sure what I'm missing.

@ethauvin
Copy link
Collaborator

ethauvin commented Sep 15, 2018

Have you tried tagging manually?

git tag -a version -m "Released version"

@johanhaleby
Copy link
Author

@ethauvin Tried it just now and it works fine

@johanhaleby
Copy link
Author

I can also do git push --tags afterwards and it also works fine

@ethauvin
Copy link
Collaborator

@johanhaleby I cloned your project and I'm seeing the same behavior, even after re-initializing git.

Kobalt is using JGit from Eclipse. Looking around I've seen people reporting the same problem when trying to tag in a subdirectory instead of the root directory. Since you have subprojects, I wonder if that is what causing the problem.

@cbeust I haven't looked at the code, but JGit might need to have the (sub)project root set prior to being called.

@johanhaleby
Copy link
Author

@ethauvin Thanks for trying it out.

Looking around I've seen people reporting the same problem when trying to tag in a subdirectory instead of the root directory

I also read up on the problem and I can confirm that I'm in the root project when I run the kobalt command. So I suppose it's likely that it's a problem with jgit or how it's used.

@johanhaleby
Copy link
Author

johanhaleby commented Sep 16, 2018

I've not looked at the Kobalt code but I've thought about it a bit and here are some guesses on what may happen.

  1. I have a "multi-project" Kobalt build sharing the same git repository
  2. I've included autoGitTag in all projects (in my case 2)
  3. When I run ./kobaltw clean test assemble uploadBintray it seems like kobalt will issue all of these commands for each project. I.e. run clean test assemble uploadBintray first for project 1 (core in my case) and then clean test assemble uploadBintray for project 2 (spring in my case).

When it comes to autoGitTag I cannot see how this will work in my case since this ought only be performed once for the entire build process when it's completed (e.g. after uploadBintray has been completed for both projects) and this doesn't seem to be the case.

I also have another thought related to this. I want to release my to projects in one go, but given the way Kobalt seem to operate, what if I do ./kobaltw clean test assemble uploadBintray and everthing works fine for project 1 but tests fail for project 2. In this case the artifacts have already been uploaded to bintray for project 1, which is not what I want nor would expect. Is this the intended behavior or am I doing something wrong?

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

3 participants