You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I try to generate the version of a submodule in my GitLab CI build. Therefore we have setup a prepare stage, which generates the version of the main repository using gittools/gitversion docker container, by passing /url ${CI_REPOSITORY_URL} /b ${CI_COMMIT_REF_NAME} /c ${CI_COMMIT_SHA}. This works fine for the version of the main repository, because the required information for dynamic repository version generation is supplied by these GitLab CI variables.
Generating the version without dynamic repository does not work (I guess due to shallow fetching?). I have tried several approaches on the fetch strategy, but I always ended up using the dynamic repository. But when using this variables, it seems, that the working directory (e.g. submodule folder) is completely ignored. So calling GitVersion on the submodule folder gives me the same version as calling gitversion on the project root folder. Locally passing the submodule folder works fine.
This is how we call the docker container:
# get the version of the main repository works fine like this
- docker run --rm -v ${CI_PROJECT_DIR}:${WIN_DOCKER_WORK_DIR} ${IMAGE_GIT} ${WIN_DOCKER_WORK_DIR} /url ${CI_REPOSITORY_URL} /b ${CI_COMMIT_REF_NAME} /c ${CI_COMMIT_SHA} | Out-File -FilePath ${VERSION_JSON}# try to get the version of the submodule located in the subfolder /core does not work as expected (delivers the version of the main repository too):
- docker run --rm -v ${CI_PROJECT_DIR}:${WIN_DOCKER_WORK_DIR} ${IMAGE_GIT} ${WIN_DOCKER_WORK_DIR}/core /url ${CI_REPOSITORY_URL} /b ${CI_COMMIT_REF_NAME} /c ${CI_COMMIT_SHA} | Out-File -FilePath ${VERSION_JSON}
Does anybody has a hint for me, how to get the version of a submodule by using dynamic repository within a GitLab CI pipeline?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I try to generate the version of a submodule in my GitLab CI build. Therefore we have setup a prepare stage, which generates the version of the main repository using gittools/gitversion docker container, by passing
/url ${CI_REPOSITORY_URL} /b ${CI_COMMIT_REF_NAME} /c ${CI_COMMIT_SHA}
. This works fine for the version of the main repository, because the required information for dynamic repository version generation is supplied by these GitLab CI variables.Generating the version without dynamic repository does not work (I guess due to shallow fetching?). I have tried several approaches on the fetch strategy, but I always ended up using the dynamic repository. But when using this variables, it seems, that the working directory (e.g. submodule folder) is completely ignored. So calling GitVersion on the submodule folder gives me the same version as calling gitversion on the project root folder. Locally passing the submodule folder works fine.
This is how we call the docker container:
Does anybody has a hint for me, how to get the version of a submodule by using dynamic repository within a GitLab CI pipeline?
Thanks ;)
Beta Was this translation helpful? Give feedback.
All reactions