GitHub Actions cross
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>pull/466/head
parent
35a60b8e04
commit
d94cbd870c
@ -1,20 +1,24 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
. $(dirname $0)/util
|
. $(dirname $0)/util
|
||||||
|
set -e
|
||||||
|
|
||||||
: ${TARGETPLATFORM=linux/amd64,linux/arm/v7,linux/arm64,darwin/amd64,windows/amd64,linux/ppc64le,linux/s390x}
|
: ${TARGETPLATFORM=linux/amd64,linux/arm/v7,linux/arm64,darwin/amd64,windows/amd64,linux/ppc64le,linux/s390x}
|
||||||
: ${CONTINUOUS_INTEGRATION=}
|
|
||||||
: ${EXPORT_LOCAL=}
|
: ${EXPORT_LOCAL=}
|
||||||
|
|
||||||
set -ex
|
importCacheFlags=""
|
||||||
|
if [ "$GITHUB_ACTIONS" = "true" ]; then
|
||||||
|
if [ -n "$cacheRefFrom" ]; then
|
||||||
|
importCacheFlags="--cache-from=type=local,src=$cacheRefFrom"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
exportFlag=""
|
exportFlag=""
|
||||||
if [ -n "$EXPORT_LOCAL" ]; then
|
if [ -n "$EXPORT_LOCAL" ]; then
|
||||||
exportFlag="--output=type=local,dest=$EXPORT_LOCAL"
|
exportFlag="--output=type=local,dest=$EXPORT_LOCAL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
progressFlag=""
|
buildxCmd build $importCacheFlags $exportFlag \
|
||||||
if [ "$CONTINUOUS_INTEGRATION" == "true" ]; then progressFlag="--progress=plain";
|
--target "binaries" \
|
||||||
fi
|
--platform "$TARGETPLATFORM" \
|
||||||
|
$currentcontext
|
||||||
buildctl build $progressFlag --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt platform=$TARGETPLATFORM $exportFlag --opt target=binaries
|
|
||||||
|
Loading…
Reference in New Issue