Skip to content

Commit

Permalink
fix: Fix model validation
Browse files Browse the repository at this point in the history
We run containers with techuser (non-root) but the environment is owned
by root. This causes any git command to fail. This commit fixes the
problem by adding `safe.directory` to the global git config.
  • Loading branch information
ewuerger committed Sep 22, 2023
1 parent 569df4b commit 1e19a4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ci-templates/gitlab/model-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ model-validation:
name: $DOCKER_REGISTRY/capella/base:${CAPELLA_DOCKER_IMAGES_TAG}
entrypoint: [""]
script:
# As our containers run with techuser (non-root) git commands fail with dubious ownership <https://gitlab.com/gitlab-org/gitlab-runner/-/issues/29022>.
- git config --global --add safe.directory ${CI_PROJECT_DIR}
- git fetch
- if [ ! -z $CI_COMMIT_BRANCH ]; then git reset --hard origin/$CI_COMMIT_BRANCH; fi
- BUILD_DIR=$(pwd)
Expand Down

0 comments on commit 1e19a4d

Please sign in to comment.