pict-rs-proxy/docker/prod/manifest.sh

44 lines
1,015 B
Bash
Raw Normal View History

#!/usr/bin/env bash
function require() {
if [ "$1" = "" ]; then
echo "input '$2' required"
print_help
exit 1
fi
}
function print_help() {
echo "deploy.sh"
echo ""
echo "Usage:"
2021-09-06 20:16:53 +00:00
echo " manifest.sh [repo] [tag]"
echo ""
echo "Args:"
2021-09-06 20:16:53 +00:00
echo " repo: The docker repository to update"
echo " tag: The git tag to be applied to the image manifest"
}
2021-09-06 20:16:53 +00:00
REPO=$1
TAG=$2
2021-09-06 20:16:53 +00:00
require "$REPO" "repo"
require "$TAG" "tag"
set -xe
2021-09-06 20:16:53 +00:00
sudo docker manifest create asonix/$REPO:$TAG \
-a asonix/$REPO:arm64v8-$TAG \
-a asonix/$REPO:arm32v7-$TAG \
-a asonix/$REPO:amd64-$TAG
2021-09-06 20:16:53 +00:00
sudo docker manifest annotate asonix/$REPO:$TAG \
asonix/$REPO:arm64v8-$TAG --os linux --arch arm64 --variant v8
2021-09-06 20:16:53 +00:00
sudo docker manifest annotate asonix/$REPO:$TAG \
asonix/$REPO:arm32v7-$TAG --os linux --arch arm --variant v7
2021-09-06 20:16:53 +00:00
sudo docker manifest annotate asonix/$REPO:$TAG \
asonix/$REPO:amd64-$TAG --os linux --arch amd64
2021-09-06 20:16:53 +00:00
sudo docker manifest push asonix/$REPO:$TAG --purge