1
- #! /bin/sh -eu
1
+ #! /bin/sh -eux
2
2
3
- if [ -n " ${CI+} " ]
3
+ # Placeholders to annotate the Github actions logs
4
+ trace_on () { true ; }
5
+ trace_off () { true ; }
6
+ section_start () { true ; }
7
+ section_end () { true ; }
8
+
9
+ if [ -n " ${CI+x} " ]
4
10
then
11
+ if [ -n " ${GITHUB_ACTION+x} " ]
5
12
set -x
6
- export PS4=' (${0}:${LINENO}): - [$?] $ '
13
+ then
14
+ # Functions to annotate the Github actions logs
15
+ trace_on () { set -x; }
16
+ trace_off () {
17
+ { set +x; } 2> /dev/null
18
+ }
19
+
20
+ section_start_internal () {
21
+ echo " ::group::$1 "
22
+ trace_on
23
+ }
24
+
25
+ section_end_internal () {
26
+ echo " ::endgroup::"
27
+ trace_on
28
+ }
29
+
30
+ section_start () {
31
+ trace_off
32
+ section_start_internal " $@ "
33
+ }
34
+ section_end () {
35
+ trace_off
36
+ section_end_internal
37
+ }
38
+ else
39
+ export PS4=' (${0}:${LINENO}): - [$?] $ '
40
+ fi
7
41
fi
8
42
9
43
if [ " $# " -eq 0 ] || [ " $# " -gt 2 ]
24
58
URL=https://www.domjudge.org/releases/domjudge-${VERSION} .tar.gz
25
59
FILE=domjudge.tar.gz
26
60
61
+ section_start " Download DOMjudge tarball"
27
62
echo " [..] Downloading DOMjudge version ${VERSION} ..."
28
63
29
64
if ! wget --quiet " ${URL} " -O ${FILE}
33
68
fi
34
69
35
70
echo " [ok] DOMjudge version ${VERSION} downloaded as domjudge.tar.gz" ; echo
71
+ section_end
36
72
73
+ section_start " Build domserver container"
37
74
echo " [..] Building Docker image for domserver..."
38
75
./build-domjudge.sh " ${NAMESPACE} /domserver:${VERSION} "
39
76
echo " [ok] Done building Docker image for domserver"
77
+ section_end
40
78
79
+ section_start " Build judgehost container (with intermediate image)"
41
80
echo " [..] Building Docker image for judgehost using intermediate build image..."
42
81
./build-judgehost.sh " ${NAMESPACE} /judgehost:${VERSION} "
43
82
echo " [ok] Done building Docker image for judgehost"
83
+ section_end
44
84
85
+ section_start " Build judgehost container (judging chroot)"
45
86
echo " [..] Building Docker image for judgehost chroot..."
46
87
docker build -t " ${NAMESPACE} /default-judgehost-chroot:${VERSION} " -f judgehost/Dockerfile.chroot .
47
88
echo " [ok] Done building Docker image for judgehost chroot"
89
+ section_end
48
90
91
+ section_start " Push instructions"
49
92
echo " All done. Image ${NAMESPACE} /domserver:${VERSION} and ${NAMESPACE} /judgehost:${VERSION} created"
50
93
echo " If you are a DOMjudge maintainer with access to the domjudge organization on Docker Hub, you can now run the following command to push them to Docker Hub:"
51
94
echo " $ docker push ${NAMESPACE} /domserver:${VERSION} && docker push ${NAMESPACE} /judgehost:${VERSION} && docker push $NAMESPACE }/default-judgehost-chroot:${VERSION} "
@@ -54,3 +97,4 @@ echo "$ docker tag ${NAMESPACE}/domserver:${VERSION} ${NAMESPACE}/domserver:late
54
97
docker tag ${NAMESPACE} /judgehost:${VERSION} ${NAMESPACE} /judgehost:latest && \
55
98
docker tag ${NAMESPACE} /default-judgehost-chroot:${VERSION} ${NAMESPACE} /default-judgehost-chroot:latest && \
56
99
docker push ${NAMESPACE} /domserver:latest && docker push ${NAMESPACE} /judgehost:latest && docker push ${NAMESPACE} /default-judgehost-chroot:latest"
100
+ section_end
0 commit comments