forked from DevExpress/DevExtreme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-ci.sh
executable file
·69 lines (51 loc) · 1.47 KB
/
docker-ci.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
#!/bin/bash -e
# Run inside https://hub.docker.com/r/devexpress/devextreme-build/
export DEVEXTREME_DOCKER_CI=true
export NUGET_PACKAGES=$PWD/dotnet_packages
function run_lint {
npm i eslint eslint-plugin-spellcheck jshint
npm run lint
}
function run_test {
local port=`node -e "console.log(require('./ports.json').qunit)"`
local url="http://localhost:$port/run?notimers=true"
local runner_pid
local runner_result=0
[ -n "$CONSTEL" ] && url="$url&constellation=$CONSTEL"
Xvfb :99 -ac -screen 0 1200x600x24 &
x11vnc -display :99 2>/dev/null &
npm i
npm run build
dotnet ./testing/runner/bin/Debug/dist/runner.dll --single-run & runner_pid=$!
while ! httping -qc1 $url; do
sleep 1
done
case "$BROWSER" in
"firefox")
firefox --version
firefox $url &
;;
*)
google-chrome-stable --version
dbus-launch google-chrome-stable \
--no-sandbox \
--no-first-run \
--no-default-browser-check \
--disable-gpu \
--disable-translate \
--user-data-dir=/tmp/chrome \
$url &
;;
esac
wait $runner_pid || runner_result=1
exit $runner_result
}
echo "node $(node -v), npm $(npm -v), dotnet $(dotnet --version)"
case "$TARGET" in
"lint") run_lint ;;
"test") run_test ;;
*)
echo "Unknown target"
exit 1
;;
esac