From bade6e1b3d9c5dbd0f3fb4ad8c237e0aa5e42e4c Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 24 Nov 2020 05:51:49 +0100 Subject: [PATCH] Fix cache for CI Signed-off-by: CrazyMax --- hack/test | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hack/test b/hack/test index a68651892..7153901c3 100755 --- a/hack/test +++ b/hack/test @@ -3,6 +3,7 @@ . $(dirname $0)/util set -eu -o pipefail +: ${TRAVIS=} : ${TEST_INTEGRATION=} : ${TEST_GATEWAY=} : ${TEST_DOCKERFILE=} @@ -17,12 +18,17 @@ if [ "$TEST_DOCKERD" == "1" ] && ! file $TEST_DOCKERD_BINARY | grep "statically exit 1 fi +importMasterCacheFlags="" +if [ "$TRAVIS" = "true" ]; then + importMasterCacheFlags="--cache-from=type=registry,ref=cicache.buildk.it/moby/buildkit/master:integration-tests" +fi + importCacheFlags="" if [ -n "$cacheref" ]; then if [ "$cachetype" = "local" ]; then - importCacheFlags="--cache-from=type=local,src=$cacheref" + importCacheFlags="--cache-from=type=local,src=$cacheref " else - importCacheFlags="--cache-from=type=registry,ref=cicache.buildk.it/moby/buildkit/master:integration-tests --cache-from=type=registry,ref=$cacheref:integration-tests" + importCacheFlags="--cache-from=type=registry,ref=$cacheref:integration-tests " fi fi @@ -58,7 +64,7 @@ if [ "$TEST_COVERAGE" = "1" ]; then coverageFlags="-coverprofile=/coverage/coverage.txt -covermode=atomic" fi -buildxCmd build $importCacheFlags \ +buildxCmd build $importMasterCacheFlags $importCacheFlags \ --target "integration-tests" \ --output "type=docker,name=$iid" \ $currentcontext