forked from dhis2/dhis2-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-containers.sh
executable file
·83 lines (51 loc) · 1.09 KB
/
publish-containers.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
#
## bash environment
#
if test "$BASH" = "" || "$BASH" -uc "a=();true \"\${a[@]}\"" 2>/dev/null; then
# Bash 4.4, Zsh
set -euo pipefail
else
# Bash 4.3 and older chokes on empty arrays with set -u.
set -eo pipefail
fi
shopt -s nullglob globstar
#
## script environment
#
CORE_IMAGE="$1"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#
## config
#
. "${DIR}/shared/containers-list.sh"
#
## funcs
#
publish () {
local IMAGE=$1
echo "Pushing $IMAGE"
docker push "$IMAGE"
}
publish_debian_containers () {
# publish the default container image
publish "$CORE_IMAGE"
# publish the variants
for TOMCAT_TAG in "${TOMCAT_DEBIAN_TAGS[@]}"; do
publish "${CORE_IMAGE}-${TOMCAT_IMAGE}-${TOMCAT_TAG}"
done
}
publish_alpine_containers () {
# publish the variants
for TOMCAT_TAG in "${TOMCAT_ALPINE_TAGS[@]}"; do
publish "${CORE_IMAGE}-${TOMCAT_IMAGE}-${TOMCAT_TAG}"
done
}
main () {
publish_debian_containers
publish_alpine_containers
}
#
## run the script
#
main