Remove git cache from Jenkins

I am trying to build a release from Maven but I am getting an error git tag already exists

even though I have removed this tag from both my local machine and the remote repository.

This question has the same problem, but for Bamboo, not Jenkins. The solution was to delete the file in Bamboo that caches the Git configuration:

<BAMBOO_HOME>/xml-data/build-dir/_git-repositories-cache

How can I do the same with Jenkins?

+3


source to share


1 answer


As a reminder, today a git repository was found cached on my master, in /var/lib/jenkins/caches

if you have many git repos you will need to find your specific one as they are listed by hashes and not by name.

[jenkins@jenkinsmaster caches]$ pwd
/var/lib/jenkins/caches
[jenkins@jenkinsmaster caches]$ ls -als
...
4 drwxr-xr-x.  3 jenkins jenkins 4096 Nov  8 09:10 git-bbcfdeb24494d83c13621c40b3b14ffd
4 drwxr-xr-x.  2 jenkins jenkins 4096 Nov  8 09:10 git-bbcfdeb24494d83c13621c40b3b14ffd@tmp
...

      



Once I found the right (by going into each and running git tag -l

to find my unwanted tags, I just delete the folder git-<hash>

and git-<hash>@tmp

from that directory. My job is re-run and the source has been fully tested again and had unwanted tags .: ^)

0


source







All Articles