add releases to travis

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2019-04-23 17:12:02 -07:00
parent c7c08e10dd
commit bc0260db73
2 changed files with 53 additions and 5 deletions

32
hack/release Executable file
View File

@ -0,0 +1,32 @@
#!/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 <tag> <out>"
exit 1
}
if [ -z "$TAG" ] || [ -z "$OUT" ]; then
usage
fi
set -x
buildctl build $progressFlag --frontend=dockerfile.v0 \
--local context=. --local dockerfile=. \
--opt target=release \
--opt platform=$PLATFORMS \
--exporter local \
--exporter-opt output=$OUT