Skip to content

Commit

Permalink
docker_upgrade.sh: Workaround for git refusing to work with a repo in…
Browse files Browse the repository at this point in the history
… attached volume
  • Loading branch information
cameel committed May 10, 2022
1 parent 571d94b commit c64fb7a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/ci/docker_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,17 @@ docker build "scripts/docker/${IMAGE_NAME}" --file "scripts/docker/${IMAGE_NAME}

echo "-- test_docker @ '${PWD}'"

docker run --rm --volume "${PWD}:/root/project" "${IMAGE_NAME}" "/root/project/scripts/ci/${IMAGE_NAME}_test_${IMAGE_VARIANT}.sh"
# NOTE: Since /root/project/ is a dir from outside the container and the owner of the files is different,
# git show in the script refuses to work. It must be marked as safe to use first.
# See https://github.blog/2022-04-12-git-security-vulnerability-announced/
docker run \
--rm \
--volume "${PWD}:/root/project" \
"${IMAGE_NAME}" \
bash -c "
git config --global --add safe.directory /root/project &&
/root/project/scripts/ci/${IMAGE_NAME}_test_${IMAGE_VARIANT}.sh
"

echo "-- push_docker"

Expand Down

0 comments on commit c64fb7a

Please sign in to comment.