2018-10-02 17:03:32 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
. $(dirname $0)/util
|
2020-11-23 18:27:49 +00:00
|
|
|
set -e
|
2018-10-02 17:03:32 +00:00
|
|
|
|
|
|
|
: ${PLATFORMS=linux/arm}
|
|
|
|
|
2019-08-08 00:50:00 +00:00
|
|
|
importCacheFlags=""
|
2020-11-23 18:27:49 +00:00
|
|
|
exportCacheFlags=""
|
|
|
|
outputFlags=""
|
|
|
|
if [ -n "$MASTERCACHE_PASSWORD" ]; then
|
2020-07-25 03:36:55 +00:00
|
|
|
$(dirname $0)/login_ci_cache
|
2020-11-23 18:27:49 +00:00
|
|
|
importCacheFlags="--cache-from=type=registry,ref=cicache.buildk.it/moby/buildkit/master:binaries-cross-helper"
|
|
|
|
exportCacheFlags="--cache-to=type=inline"
|
|
|
|
outputFlags="--output=type=image,push=true,name=cicache.buildk.it/moby/buildkit/master:binaries-cross-helper"
|
|
|
|
elif [ "$GITHUB_ACTIONS" = "true" ]; then
|
|
|
|
if [ -n "$cacheref" ]; then
|
|
|
|
importCacheFlags="--cache-from=type=local,src=$cacheref"
|
|
|
|
exportCacheFlags="--cache-to=type=local,dest=$cacheref"
|
|
|
|
fi
|
2019-08-08 00:50:00 +00:00
|
|
|
fi
|
|
|
|
|
2020-11-23 18:27:49 +00:00
|
|
|
if [ -n "$RUNC_PLATFORMS" ]; then
|
|
|
|
buildxCmd build $importCacheFlags $exportCacheFlags $outputFlags \
|
|
|
|
--target "binaries-linux-helper" \
|
|
|
|
--platform "$RUNC_PLATFORMS" \
|
|
|
|
$currentcontext
|
|
|
|
fi
|
2020-01-31 04:21:40 +00:00
|
|
|
|
2020-11-23 18:27:49 +00:00
|
|
|
buildxCmd build $importCacheFlags \
|
|
|
|
--platform "$PLATFORMS" \
|
|
|
|
$currentcontext
|