forked from mozilla-b2g/gaia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci
More file actions
executable file
·61 lines (52 loc) · 1.07 KB
/
Copy pathci
File metadata and controls
executable file
·61 lines (52 loc) · 1.07 KB
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
#! /bin/bash -e
# XXX: At some point we probably don't need travis specific logic but for now
# it's very easy to use this with environment variables to keep everything
# running as it does in travis.
# test suite root for all travis ci hook style tests...
suite_root="tests/ci"
usage() {
echo
echo " Usage: ./bin/ci [command] [args]"
echo
echo " Commands:"
echo
echo " run <suite> - run a particular test suite (use ls to see all suites)"
echo " ls - list all the test suites which can be run"
echo
echo
}
cmd_ls() {
ls $suite_root
}
cmd_run() {
local steps="before_install install before_script script"
local root="$suite_root/$1/"
if [ ! -d $root ] || [ "$1" == "" ] || [ "$1" == " " ];
then
echo "CI suite $1 does not exist in path $root"
echo
echo "Allowed suites:"
echo
echo "$(cmd_ls)"
echo
usage
exit 1
fi
for step in $steps; do
if [ -x "$root/$step" ];
then
eval "$root/$step"
fi
done
}
case "$1" in
"run")
cmd_run ${@:2}
;;
"ls")
cmd_ls
;;
*)
usage
;;
esac