-
Notifications
You must be signed in to change notification settings - Fork 3
/
build-platform-5.sh
executable file
·168 lines (133 loc) · 5.47 KB
/
build-platform-5.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/bash
exit_with () {
[ "$2" != "" ] && echo -e $2 >&2
exit ${1:-0}
}
REGISTRY=registry.simplicite.io
PUSH=1
if [ "$1" = "--no-push" ]
then
PUSH=0
shift
fi
[ "$1" = "" -o "$1" = "--help" ] && exit_with 1 "\nUsage: \e[1m$(basename $0)\e[0m <preview|latest|5.x> [<additional tags, e.g. \"5.x 5.x.y\">]\n"
TARGET=$1
shift
# -------------------------------------------------------------------------------------------
# Preview version
# -------------------------------------------------------------------------------------------
if [ "$TARGET" = "preview" ]
then
./build-platform.sh --delete 5-preview almalinux9-17 || exit_with $? "Unable to build platform version 5-preview"
docker rmi $REGISTRY/platform:5-preview > /dev/null 2>&1
docker tag $REGISTRY/platform:5-preview-almalinux9-17 $REGISTRY/platform:5-preview
docker rmi $REGISTRY/platform:5-preview-almalinux9-17
fi
if [ "$TARGET" = "preview-jre" ]
then
./build-platform.sh --delete 5-preview-almalinux9-17-jre || exit_with $? "Unable to build platform version 5-preview-jre"
docker rmi $REGISTRY/platform:5-preview-jre > /dev/null 2>&1
docker tag $REGISTRY/platform:5-preview-almalinux9-17-jre $REGISTRY/platform:5-preview-jre
docker rmi $REGISTRY/platform:5-preview-almalinux9-17-jre
fi
# -------------------------------------------------------------------------------------------
# Current version
# -------------------------------------------------------------------------------------------
if [ "$TARGET" = "latest" ]
then
./build-platform.sh --delete 5-latest || exit_with $? "Unable to build platform version 5-latest"
docker rmi $REGISTRY/platform:5-latest > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest-almalinux9-17 $REGISTRY/platform:5-latest
docker rmi $REGISTRY/platform:5-latest-almalinux9-17
docker rmi $REGISTRY/platform:5-latest-jre > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest-almalinux9-17-jre $REGISTRY/platform:5-latest-jre
docker rmi $REGISTRY/platform:5-latest-almalinux9-17-jre
docker rmi $REGISTRY/platform:5-latest-jvmless > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest-almalinux9-jvmless $REGISTRY/platform:5-latest-jvmless
docker rmi $REGISTRY/platform:5-latest-almalinux9-jvmless
docker rmi $REGISTRY/platform:5 > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest $REGISTRY/platform:5
if [ $PUSH -eq 1 ]
then
./push-to-registries.sh --delete platform \
5-latest-alpine \
5-latest-alpine-jre \
5-latest-jvmless \
5-latest-jre \
5
./push-to-registries.sh platform 5-latest
fi
# All additional tags
for TAG in $@
do
docker rmi $REGISTRY/platform:$TAG > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest $REGISTRY/platform:$TAG
if [ $PUSH -eq 1 ]
then
./push-to-registries.sh --delete platform $TAG
fi
done
./build-platform.sh --delete 5-latest-light || exit_with $? "Unable to build platform version 5-latest-light"
docker rmi $REGISTRY/platform:5-latest-light > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest-light-almalinux9-17 $REGISTRY/platform:5-latest-light
docker rmi $REGISTRY/platform:5-latest-light-almalinux9-17
docker rmi $REGISTRY/platform:5-latest-light-jre > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest-light-almalinux9-17-jre $REGISTRY/platform:5-latest-light-jre
docker rmi $REGISTRY/platform:5-latest-light-almalinux9-17-jre
docker rmi $REGISTRY/platform:5-latest-light-jvmless > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest-light-almalinux9-jvmless $REGISTRY/platform:5-latest-light-jvmless
docker rmi $REGISTRY/platform:5-latest-light-almalinux9-jvmless
docker rmi $REGISTRY/platform:5-light > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest-light $REGISTRY/platform:5-light
if [ $PUSH -eq 1 ]
then
./push-to-registries.sh --delete platform \
5-latest-light-alpine \
5-latest-light-alpine-jre \
5-latest-light-jvmless \
5-latest-light-jre \
5-light
./push-to-registries.sh platform 5-latest-light
fi
# First additional tag only
for TAG in $1
do
docker rmi $REGISTRY/platform:$TAG-light > /dev/null 2>&1
docker tag $REGISTRY/platform:5-latest-light $REGISTRY/platform:$TAG-light
if [ $PUSH -eq 1 ]
then
./push-to-registries.sh --delete platform $TAG-light
fi
done
docker rmi $REGISTRY/platform:5-latest-light
fi
# -------------------------------------------------------------------------------------------
# Previous versions
# -------------------------------------------------------------------------------------------
if [ "$TARGET" = "5.0" -o "$TARGET" = "5.1" -o "$TARGET" = "5.2" ]
then
./build-platform.sh --delete $TARGET || exit_with $? "Unable to build platform version $TARGET"
./build-platform.sh --delete $TARGET-light || exit_with $? "Unable to build platform version $TARGET-light"
docker rmi $REGISTRY/platform:$TARGET > /dev/null 2>&1
docker tag $REGISTRY/platform:$TARGET-centos-17 $REGISTRY/platform:$TARGET
docker rmi $REGISTRY/platform:$TARGET-centos-17
docker rmi $REGISTRY/platform:$TARGET-light > /dev/null 2>&1
docker tag $REGISTRY/platform:$TARGET-light-centos-17 $REGISTRY/platform:$TARGET-light
docker rmi $REGISTRY/platform:$TARGET-light-centos-17
if [ $PUSH -eq 1 ]
then
./push-to-registries.sh platform $TARGET
./push-to-registries.sh --delete platform $TARGET-light
fi
# All additional tags
for TAG in $@
do
docker rmi $REGISTRY/platform:$TAG > /dev/null 2>&1
docker tag $REGISTRY/platform:$TARGET $REGISTRY/platform:$TAG
if [ $PUSH -eq 1 ]
then
./push-to-registries.sh --delete platform $TAG
fi
done
fi
exit_with