2018-10-11 06:46:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
TAG=$1
|
|
|
|
OUT=$2
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
: ${PLATFORMS=linux/amd64}
|
|
|
|
: ${CONTINUOUS_INTEGRATION=}
|
|
|
|
|
|
|
|
progressFlag=""
|
|
|
|
if [ "$CONTINUOUS_INTEGRATION" == "true" ]; then progressFlag="--progress=plain"; fi
|
|
|
|
|
|
|
|
|
|
|
|
usage() {
|
|
|
|
echo "usage: ./hack/release-tar <tag> <out>"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ -z "$TAG" ] || [ -z "$OUT" ]; then
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
|
|
|
--local context=. --local dockerfile=. \
|
2019-03-20 10:18:16 +00:00
|
|
|
--opt target=release \
|
|
|
|
--opt platform=$PLATFORMS \
|
2018-10-11 06:46:34 +00:00
|
|
|
--exporter local \
|
|
|
|
--exporter-opt output=$OUT
|