2018-10-11 06:46:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
TAG=$1
|
|
|
|
OUT=$2
|
|
|
|
|
2020-11-24 21:51:52 +00:00
|
|
|
. $(dirname $0)/util
|
2018-10-11 06:46:34 +00:00
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
: ${PLATFORMS=linux/amd64}
|
|
|
|
|
|
|
|
usage() {
|
|
|
|
echo "usage: ./hack/release-tar <tag> <out>"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2020-07-25 03:36:55 +00:00
|
|
|
if [ -z "$TAG" ] || [ -z "$OUT" ]; then
|
2018-10-11 06:46:34 +00:00
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
2020-11-24 21:51:52 +00:00
|
|
|
importCacheFlags=""
|
2020-11-29 05:45:33 +00:00
|
|
|
if [[ -n "$cacheRefFrom" ]] && [[ "$cacheType" = "local" ]]; then
|
|
|
|
for ref in $cacheRefFrom; do
|
2020-11-24 21:51:52 +00:00
|
|
|
importCacheFlags="$importCacheFlags--cache-from=type=local,src=$ref "
|
|
|
|
done
|
|
|
|
fi
|
2018-10-11 06:46:34 +00:00
|
|
|
|
2020-11-24 21:51:52 +00:00
|
|
|
buildxCmd build $importCacheFlags \
|
|
|
|
--target release \
|
|
|
|
--platform "$PLATFORMS" \
|
|
|
|
--output "type=local,dest=$OUT" \
|
|
|
|
$currentcontext
|