pict-rs-aggregator/docker/prod/manifest.sh
2020-12-08 16:03:18 -06:00

44 lines
992 B
Bash
Executable file

#!/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:"
echo " manifest.sh [repository] [tag]"
echo ""
echo "Args:"
echo " repository: The docker repository hosting the images"
echo " tag: The git tag to be applied to the image manifest"
}
repo=$1
new_tag=$2
require "$repo" "repository"
require "$new_tag" "tag"
set -xe
docker manifest create $repo:$new_tag \
-a $repo:arm64v8-$new_tag \
-a $repo:arm32v7-$new_tag \
-a $repo:amd64-$new_tag
docker manifest annotate $repo:$new_tag \
$repo:arm64v8-$new_tag --os linux --arch arm64 --variant v8
docker manifest annotate $repo:$new_tag \
$repo:arm32v7-$new_tag --os linux --arch arm --variant v7
docker manifest annotate $repo:$new_tag \
$repo:amd64-$new_tag --os linux --arch amd64
docker manifest push $repo:$new_tag --purge