Closed anekdoti closed 4 years ago
Please have a look at how I've managed to get GitVersion to work to see whether it gives you any ideas for how to fix your problems:
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.
Thank you for sharing that @asbjornu. We're running our builds on TeamCity, and the fact that GitVersion now seems to require the master branch to be present was causing me issues in upgrading to the latest GitVersion as well. Definitely kind of lame that you need to force the build to check out master
or main
, but I'm happy this workaround solves my problem.
I have a
Dockerfile
that creates an image fromgittools/gitversion:5.1.4-linux
. It copies the content of the context folder into a workdir/src
in the image. The copy includes in particular the.git
folder and aGitVersion.yml
. Afterwards, Gitversion is invoked usingdotnet /app/GitVersion.dll /showvariable SemVer .
Running
docker build .
locally in the root folder of a cloned git repository works fine and computes the SemVer based on the git history.However, when running the docker build as a build step in TeamCity using a docker runner, the following exception, similar to the one described in #1753, is thrown:
The environment variable
Git_Branch
is setup properly in the Dockerfile, and the.git
folder is copied correctly (I listed its content in the Dockerfile to be sure).I would be very interested to find out the reason and possible solutions for this problem.