Skip to content

Commit

Permalink
hack: mount docker config on gha
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Feb 11, 2025
1 parent f580211 commit 295653d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hack/test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -eu -o pipefail

: "${GITHUB_ACTIONS=}"

: "${BUILDX_CMD=docker buildx}"

: "${TEST_COVERAGE=}"
Expand Down Expand Up @@ -37,7 +39,15 @@ if [ "$TEST_COVERAGE" = "1" ]; then
export GO_TEST_COVERPROFILE="/testreports/coverage-report$TEST_REPORT_SUFFIX.txt"
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 \
--volumes-from=$cacheVolume \
-e GITHUB_REF \
Expand Down

0 comments on commit 295653d

Please sign in to comment.