-
Notifications
You must be signed in to change notification settings - Fork 249
/
chroot_checks.sh
executable file
·45 lines (36 loc) · 1.36 KB
/
chroot_checks.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
#!/bin/bash
. gitlab/ci_settings.sh
function finish() {
echo -e "\\n\\n=======================================================\\n"
echo "Storing artifacts..."
trace_on
set +e
cp /proc/cmdline "$GITLABARTIFACTS/cmdline"
cp /chroot/domjudge/etc/apt/sources.list "$GITLABARTIFACTS/sources.list"
cp /chroot/domjudge/debootstrap/debootstrap.log "$GITLABARTIFACTS/debootstrap.log"
}
trap finish EXIT
section_start setup "Setup and install"
lsb_release -a
# configure, make and install (but skip documentation)
make configure
./configure --with-baseurl='http:https://localhost/domjudge/' --with-domjudge-user=domjudge --with-judgehost_chrootdir=${DIR}/chroot/domjudge |& tee "$GITLABARTIFACTS/configure.log"
make judgehost |& tee "$GITLABARTIFACTS/make.log"
sudo make install-judgehost |& tee -a "$GITLABARTIFACTS/make.log"
section_end setup
section_start mount "Show runner mounts"
# Currently gitlab has some runners with noexec/nodev,
# This can be removed if we have more stable runners.
mount -o remount,exec,dev /builds
section_end mount
section_start chroot "Configure chroot"
if [ -e ${DIR}/chroot/domjudge ]; then
rm -rf ${DIR}/chroot/domjudge
fi
cd ${DIR}/misc-tools || exit 1
section_end chroot
section_start chroottest "Test chroot contents"
cp ${DIR}/submit/assert.bash ./
cp ${DIR}/gitlab/chroot.bats ./
bats ./chroot.bats
section_end chroottest