devops: proper fix for git directory permissions (#16020)

This commit is contained in:
Andrey Lushnikov 2022-07-28 06:30:04 -07:00 committed by GitHub
parent 2733924d1d
commit abf951ebec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,12 +187,8 @@ function ensure_docker_container {
git config --system http.lowSpeedLimit 0
git config --system http.lowSpeedTime 999999
# set git safe directory
git config --system --add safe.directory /home/pwuser/playwright
su pwuser
cd /home/pwuser
git clone --depth=1 https://github.com/microsoft/playwright
su -l pwuser -c "git clone --depth=1 https://github.com/microsoft/playwright"
'
}
@ -216,6 +212,8 @@ elif [[ "$2" == "enter" || -z "$2" ]]; then
docker exec --user pwuser --workdir "/home/pwuser/playwright" ${DOCKER_ARGS} -it "${DOCKER_CONTAINER_NAME}" /bin/bash
elif [[ "$2" == "kill" || "$2" == "stop" ]]; then
docker kill "${DOCKER_CONTAINER_NAME}"
# Wait for container to stop
docker wait "${DOCKER_CONTAINER_NAME}" || true
else
echo "ERROR: unknown command - $2"
exit 1