This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrelease-push.sh
executable file
·68 lines (60 loc) · 2.94 KB
/
release-push.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
set -o errexit # Abort script at first error (command exits non-zero).
root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
reset=$(tput sgr0)
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
if [[ -z $1 ]] ; then
>&2 echo "Missing argument!"
echo "Usage:"
echo " release-build.sh <version>"
echo ""
echo "Example:"
echo " release-build.sh 0.9.3"
exit 1
else
TAG="$1"
if [[ $( git describe --tags ) != "$TAG" ]] ; then
>&2 echo "${red}Error: Provided tag doesn't match repository tag!${reset}"
>&2 echo "Have you exectued 'release-tag.sh'???"
>&2 echo "Exiting..."
exit 1
fi
fi
echo "${green}
██╗ ██╗ █████╗ ███╗ ███╗██████╗ ██████╗ ██╗ ██╗███████╗██╗ ██╗███████╗██████╗
██║ ██║██╔══██╗████╗ ████║██╔══██╗ ██╔══██╗██║ ██║██╔════╝██║ ██║██╔════╝██╔══██╗
██║ ██║███████║██╔████╔██║██████╔╝ ██████╔╝██║ ██║███████╗███████║█████╗ ██████╔╝
╚██╗ ██╔╝██╔══██║██║╚██╔╝██║██╔═══╝ ██╔═══╝ ██║ ██║╚════██║██╔══██║██╔══╝ ██╔══██╗
╚████╔╝ ██║ ██║██║ ╚═╝ ██║██║ ██║ ╚██████╔╝███████║██║ ██║███████╗██║ ██║
╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
by magnetic.io
${reset}"
docker_images="
magneticio/vamp:${TAG}
magneticio/vamp:${TAG}-custom
magneticio/vamp:${TAG}-dcos
magneticio/vamp:${TAG}-kubernetes
magneticio/vamp-ee:${TAG}
magneticio/vamp-ee:${TAG}-dcos
magneticio/vamp-runner:${TAG}
magneticio/vamp-gateway-agent:${TAG}
magneticio/vamp-workflow-agent:${TAG}
magneticio/vamp-docker:${TAG}
"
# Check that we have our images available
for image in $docker_images ; do
if [[ $( docker images --format "{{.Repository}}:{{.Tag}}" "$image" ) = "$image" ]] ; then
echo "${green}Found matching image: ${image}${reset}"
else
>&2 echo "${red}Error: No such image: ${image}${reset}"
>&2 echo "Have you exectued 'release-build.sh'???"
>&2 echo "Exiting..."
exit 1
fi
done
for image in $docker_images ; do
echo "${green}Pushing image: ${image}${reset}"
docker push "$image"
done