Add Makefile and bin/ scripts for one-command multi-arch release
make release builds, smoke-tests and pushes amd64 (on fsn1app1 via DOCKER_HOST) and arm64 (local), joins them into latest and dated multi-arch manifests, and commits the day's logs. Logic lives in bin/; the Makefile only wires dependencies so -j2 runs the arches in parallel.
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
# Shared setup for bin/ scripts. Source after `set -euo pipefail`.
|
||||
#
|
||||
# Expects IMAGE and DATE in the environment (the Makefile exports them) and
|
||||
# takes the target arch as $1 where relevant.
|
||||
|
||||
: "${IMAGE:=git.eeqj.de/sneak/baseimage}"
|
||||
: "${DATE:=$(date +%Y-%m-%d)}"
|
||||
|
||||
LOGDIR="logs/$DATE"
|
||||
mkdir -p "$LOGDIR"
|
||||
|
||||
# Point docker at the daemon for the given arch. DOCKER_HOST_<arch> empty or
|
||||
# unset means the local daemon.
|
||||
use_arch_host() {
|
||||
local arch="$1" var host
|
||||
var="DOCKER_HOST_${arch}"
|
||||
host="${!var:-}"
|
||||
if [ -n "$host" ]; then
|
||||
export DOCKER_HOST="$host"
|
||||
else
|
||||
unset DOCKER_HOST
|
||||
fi
|
||||
local actual
|
||||
actual="$(docker version --format '{{.Server.Arch}}')"
|
||||
if [ "$actual" != "$arch" ]; then
|
||||
echo "error: daemon for $arch (${host:-local}) reports arch $actual" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
dev_tag() { echo "baseimage:dev-$1"; }
|
||||
arch_tag() { echo "$IMAGE:$1"; }
|
||||
Reference in New Issue
Block a user