2019-08-08 00:50:00 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
. $(dirname $0)/util
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ -z "$TRAVIS_COMMIT" ]; then
|
|
|
|
echo "TRAVIS_COMMIT_REQURED"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-08-21 00:26:48 +00:00
|
|
|
progressFlag=""
|
|
|
|
if [ "$CONTINUOUS_INTEGRATION" == "true" ]; then progressFlag="--progress=plain"; fi
|
|
|
|
|
2019-08-08 00:50:00 +00:00
|
|
|
exportCacheFlags=""
|
|
|
|
exportFlags=""
|
|
|
|
|
|
|
|
if [ -f /tmp/buildkit-ci-cache-repo ]; then
|
|
|
|
exportCacheFlags="--export-cache=type=inline"
|
|
|
|
exportFlags="--output=type=image,push=true,name=$(cat /tmp/buildkit-ci-cache-repo)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -x
|
|
|
|
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
|
|
|
$currentcontextBuildctl \
|
|
|
|
--opt target=binaries \
|
|
|
|
--import-cache type=registry,ref=cicache.buildk.it/moby/buildkit/master:binaries \
|
|
|
|
--import-cache type=registry,ref=cicache.buildk.it/moby/buildkit/master:integration-tests \
|
|
|
|
$exportCacheFlags $exportFlags:binaries
|
|
|
|
|
|
|
|
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
|
|
|
$currentcontextBuildctl \
|
|
|
|
--opt target=integration-tests-base \
|
2020-05-13 14:49:52 +00:00
|
|
|
--import-cache type=registry,ref=cicache.buildk.it/moby/buildkit/master:integration-tests \
|
2019-08-08 00:50:00 +00:00
|
|
|
$exportCacheFlags $exportFlags:integration-tests
|