forked from buildbot/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·67 lines (55 loc) · 1.33 KB
/
run.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
#!/bin/bash
set -e
set -v
cd `dirname $0`
YARN=$(which yarnpkg || which yarn)
if [ $? -ne 0 ]; then
echo "Neither yarnpkg nor yarn is available"
exit 1
fi
echo "Using ${YARN} as yarn"
function finish_failed_start {
set +e
kill %1
buildbot stop workdir
cat workdir/twistd.log
rm -rf workdir
}
function finish {
# uncomment for debug in kube
# for i in `seq 1000`
# do
# echo please debug me!
# sleep 60
# done
set +e
kill %1
buildbot stop workdir
buildbot-worker stop workdir/worker
rm -rf workdir
}
trap finish_failed_start EXIT
rm -rf workdir
buildbot create-master workdir
ln -s ../templates ../master.cfg workdir
buildbot-worker create-worker workdir/worker localhost example-worker pass
buildbot checkconfig workdir
# on docker buildbot might be a little bit slower to start, so sleep another 20s in case of start to slow.
buildbot start workdir || sleep 20
buildbot-worker start workdir/worker
trap finish EXIT
cat workdir/twistd.log &
YARNPROG=""
for Y in yarnpkg yarn; do
$Y --version > /dev/null
if [ $? -eq 0 ]; then
YARNPROG=$Y
fi
done
if [ -z $YARNPROG ]; then
echo "Neither yarn nor yarnpkg is installed"
exit 1
fi
$YARNPROG install --pure-lockfile
$YARNPROG playwright install
LIBGL_ALWAYS_SOFTWARE=1 $YARNPROG playwright test