We're running an on-prem installation of Bamboo 6.5. I'm trying to setup a build job to run in a docker container. However, at one point I run a script in the job which runs
git diff master --name-only
error: object directory /var/atlassian/application-data/bamboo/xml-data/build-dir/_git-repositories-cache/a8a7e8c0985e56b918179b7d01e7ed1189667581/.git/objects does not exist; check .git/objects/info/alternates
fatal: bad object master
I have git 1.8 on the server running Bamboo and the Docker container is running git version 2.34.1, which might be the source of the error. I see that Bamboo creates a docker volume for the pulled source, but I do specify that a clean clone be done every time, and I thought the git clone or pull happens in the container, not in the host. I don't think I can update the global version of git on the Bamboo host at this time, and it doesn't seem too easy to install an older version of git in the container.
Any suggestions?
I wish I'd read the error message more carefully at first. I had assumed it was having trouble with the .git/object directory in the local repo, but the path is actually the remote, which is some kind of git cache bamboo makes. That remote is in the local file system but was not mapped in the docker container.
So I mapped /var/atlassian/application-data/bamboo/xml-data/build-dir/_git-repositories-cache as a docker volume and I'm able to run git commands within the container now.
I was also mistaken in assuming that the git clone happens inside the container. It happens on the host.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.