hack: mount docker config on gha

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2024-11-21 15:22:38 +01:00
parent 4b5d78db9b
commit d83af5133e
No known key found for this signature in database
GPG Key ID: ADE44D8C9D44FBE4
1 changed files with 11 additions and 1 deletions

View File

@ -2,6 +2,8 @@
set -eu -o pipefail set -eu -o pipefail
: "${GITHUB_ACTIONS=}"
: "${BUILDX_CMD=docker buildx}" : "${BUILDX_CMD=docker buildx}"
: "${TEST_COVERAGE=}" : "${TEST_COVERAGE=}"
@ -37,7 +39,15 @@ if [ "$TEST_COVERAGE" = "1" ]; then
export GO_TEST_COVERPROFILE="/testreports/coverage-report$TEST_REPORT_SUFFIX.txt" export GO_TEST_COVERPROFILE="/testreports/coverage-report$TEST_REPORT_SUFFIX.txt"
fi fi
cid=$(docker create --rm --privileged \ dockerConfigMount=""
if [ "$GITHUB_ACTIONS" = "true" ]; then
dockerConfigPath="$HOME/.docker/config.json"
if [ -f "$dockerConfigPath" ]; then
dockerConfigMount="-v $dockerConfigPath:/root/.docker/config.json:ro"
fi
fi
cid=$(docker create --rm --privileged $dockerConfigMount \
-v /tmp $testReportsVol \ -v /tmp $testReportsVol \
--volumes-from=$cacheVolume \ --volumes-from=$cacheVolume \
-e GITHUB_REF \ -e GITHUB_REF \