From b4593002cbe8139540883b8e10ecb03116351343 Mon Sep 17 00:00:00 2001 From: sneak Date: Fri, 9 Dec 2022 00:40:53 +0100 Subject: [PATCH] latest --- tagimage.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tagimage.sh diff --git a/tagimage.sh b/tagimage.sh new file mode 100644 index 0000000..50bd088 --- /dev/null +++ b/tagimage.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euox pipefail + +if [[ "$(uname -m)" != "arm64" ]]; then + echo "wrong box, run on macOS arm workstation after CI" > /dev/stderr + exit 1 +fi + +GITREV="$(git describe --always --dirty=-dirty)" +BRANCH="$(git branch --show-current)" +YYYYMMDD="$(date -u +%Y-%m-%d)" +RN="sneak/builder" + +for TAG in $GITREV latest $YYYYMMDD $BRANCH ; do + # pull down the amd64 images from the CI box + docker pull $RN:$TAG-x86_64 + docker manifest create \ + $RN:$TAG \ + --amend $RN:$TAG-arm64 \ + --amend $RN:$TAG-x86_64 + docker manifest push $RN:$TAG +done