Skip to content

Commit a59d7a1

Browse files
committed
Add development service convenience runner "openqa-run"
1 parent ff00eea commit a59d7a1

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

docs/Contributing.asciidoc

+11
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,17 @@ assets can need a big amount of disk space.
293293

294294
WARNING: Be sure to *clear* that variable when running unit tests locally.
295295

296+
For convenience you can use the `openqa-run` wrapper in to call openQA
297+
services with `OPENQA_BASEDIR` set to your local development environment with
298+
the appropriate service account. For example to start the openQA GRU service
299+
call:
300+
301+
[source,sh]
302+
----
303+
tools/openqa-run script/openqa-gru
304+
----
305+
306+
296307
=== Customize configuration directory
297308
It can be necessary during development to change the configuration.
298309
For example you have to edit `etc/openqa/database.ini` to use another database.

tools/openqa-run

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
usage() {
5+
cat << EOF
6+
Usage: openqa-run [OPTIONS...] OPENQA_SERVICE
7+
Call an openQA service OPENQA_SERVICE with appropriate user account and the
8+
base-dir set to the local working copy.
9+
10+
Example:
11+
openqa-run openqa-webui-daemon
12+
13+
Options:
14+
-h, --help display this help
15+
EOF
16+
exit "$1"
17+
}
18+
19+
OPENQA_BASEDIR="${OPENQA_BASEDIR:-"$(dirname "$0")/../t/data"}"
20+
21+
opts=$(getopt -o h --long help -n "$0" -- "$@") || usage 1
22+
eval set -- "$opts"
23+
while true; do
24+
case "$1" in
25+
-h | --help) usage 0 ;;
26+
--)
27+
shift
28+
break
29+
;;
30+
*) break ;;
31+
esac
32+
done
33+
34+
main() {
35+
sudo -u geekotest OPENQA_BASEDIR="${OPENQA_BASEDIR}" "$@"
36+
}
37+
38+
caller 0 > /dev/null || main "$@"

0 commit comments

Comments
 (0)