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:"
|
2021-09-20 17:56:14 +00:00
|
|
|
echo " manifest.sh [repo] [tag]"
|
2020-06-10 22:45:59 +00:00
|
|
|
echo ""
|
|
|
|
echo "Args:"
|
2021-09-20 17:56:14 +00:00
|
|
|
echo " repo: The docker repository to update"
|
2020-06-10 22:45:59 +00:00
|
|
|
echo " tag: The git tag to be applied to the image manifest"
|
|
|
|
}
|
|
|
|
|
2021-09-20 17:56:14 +00:00
|
|
|
REPO=$1
|
|
|
|
TAG=$2
|
2020-06-10 22:45:59 +00:00
|
|
|
|
2021-09-20 17:56:14 +00:00
|
|
|
require "$REPO" "repo"
|
|
|
|
require "$TAG" "tag"
|
2020-06-10 22:45:59 +00:00
|
|
|
|
|
|
|
set -xe
|
|
|
|
|
2021-09-20 17:56:14 +00:00
|
|
|
sudo docker manifest create asonix/$REPO:$TAG \
|
|
|
|
-a asonix/$REPO:arm64v8-$TAG \
|
|
|
|
-a asonix/$REPO:arm32v7-$TAG \
|
|
|
|
-a asonix/$REPO:amd64-$TAG
|
2020-06-10 22:45:59 +00:00
|
|
|
|
2021-09-20 17:56:14 +00:00
|
|
|
sudo docker manifest annotate asonix/$REPO:$TAG \
|
|
|
|
asonix/$REPO:arm64v8-$TAG --os linux --arch arm64 --variant v8
|
2020-06-10 22:45:59 +00:00
|
|
|
|
2021-09-20 17:56:14 +00:00
|
|
|
sudo docker manifest annotate asonix/$REPO:$TAG \
|
|
|
|
asonix/$REPO:arm32v7-$TAG --os linux --arch arm --variant v7
|
2020-06-10 22:45:59 +00:00
|
|
|
|
2021-09-20 17:56:14 +00:00
|
|
|
sudo docker manifest annotate asonix/$REPO:$TAG \
|
|
|
|
asonix/$REPO:amd64-$TAG --os linux --arch amd64
|
2020-06-10 22:45:59 +00:00
|
|
|
|
2021-09-20 17:56:14 +00:00
|
|
|
sudo docker manifest push asonix/$REPO:$TAG --purge
|