relay/docker/prod/manifest.sh

44 lines
920 B
Bash
Raw Permalink Normal View History

2020-06-10 22:45:59 +00:00
#!/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 [tag]"
echo ""
echo "Args:"
echo " repo: The docker repository to push the manifest to"
echo " tag: The git tag to be applied to the image manifest"
}
2020-06-11 00:00:29 +00:00
repo=$1
2020-06-10 22:45:59 +00:00
tag=$2
require "$repo" "repo"
require "$tag" "tag"
set -xe
docker manifest create $repo:$tag \
2020-06-11 00:29:05 +00:00
-a $repo:$tag-arm64v8 \
-a $repo:$tag-arm32v7 \
-a $repo:$tag-amd64
2020-06-10 22:45:59 +00:00
docker manifest annotate $repo:$tag \
2020-06-11 00:29:05 +00:00
$repo:$tag-arm64v8 --os linux --arch arm64 --variant v8
2020-06-10 22:45:59 +00:00
docker manifest annotate $repo:$tag \
2020-06-11 00:29:05 +00:00
$repo:$tag-arm32v7 --os linux --arch arm --variant v7
2020-06-10 22:45:59 +00:00
docker manifest annotate $repo:$tag \
2020-06-11 00:29:05 +00:00
$repo:$tag-amd64 --os linux --arch amd64
2020-06-10 22:45:59 +00:00
docker manifest push $repo:$tag --purge