forked from MariaDB/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate_master_cfg.sh
executable file
·54 lines (48 loc) · 1.27 KB
/
validate_master_cfg.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
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
set -o posix
err() {
echo >&2 "ERROR: $*"
exit 1
}
[[ -f master-private.cfg ]] ||
ln -s master-private.cfg-sample master-private.cfg
[[ -f master-config.yaml ]] ||
ln -s master-config.yaml-sample master-config.yaml
if command -v podman >/dev/null; then
RUNC=podman
else
if command -v docker >/dev/null; then
RUNC=docker
else
err "need a container system (docker/podman)"
fi
fi
command -v python3 >/dev/null ||
err "python3 command not found"
python3 define_masters.py
echo "Checking master.cfg"
$RUNC run -i -v "$(pwd):/srv/buildbot/master" \
-w /srv/buildbot/master \
quay.io/mariadb-foundation/bb-master:master \
buildbot checkconfig master.cfg
echo -e "done\n"
# not checking libvirt config file (//TEMP we need to find a solution
# to not check ssh connection)
for dir in autogen/* \
master-bintars \
master-docker-nonstandard \
master-docker-nonstandard-2 \
master-galera \
master-nonlatent \
master-protected-branches \
master-web; do
echo "Checking $dir/master.cfg"
$RUNC run -i -v "$(pwd):/srv/buildbot/master" \
-w /srv/buildbot/master \
quay.io/mariadb-foundation/bb-master:master \
bash -c "cd $dir && buildbot checkconfig master.cfg"
echo -e "done\n"
done