Skip to content

Commit

Permalink
Add development service convenience runner "openqa-run"
Browse files Browse the repository at this point in the history
  • Loading branch information
okurz committed Jul 31, 2024
1 parent fffb458 commit aa7729f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/Contributing.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,17 @@ assets can need a big amount of disk space.

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

For convenience you can use the `openqa-run` wrapper in to call openQA
services with `OPENQA_BASEDIR` set to your local development environment with
the appropriate service account. For example to start the openQA GRU service
call:

[source,sh]
----
tools/openqa-run script/openqa-gru
----


=== Customize configuration directory
It can be necessary during development to change the configuration.
For example you have to edit `etc/openqa/database.ini` to use another database.
Expand Down
39 changes: 39 additions & 0 deletions tools/openqa-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
set -euo pipefail

usage() {
cat << EOF
Usage: openqa-run [OPTIONS...] OPENQA_SERVICE
Call an openQA service OPENQA_SERVICE with appropriate user account and the
base-dir set to the local working copy.
Example:
openqa-run openqa-webui-daemon
Options:
-h, --help display this help
EOF
exit "$1"
}

OPENQA_BASEDIR="${OPENQA_BASEDIR:-"$(dirname "$0")/../t/data"}"
export OPENQA_BASEDIR

opts=$(getopt -o h --long help -n "$0" -- "$@") || usage 1
eval set -- "$opts"
while true; do
case "$1" in
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
esac
done

main() {
"$@"
}

caller 0 > /dev/null || main "$@"

0 comments on commit aa7729f

Please sign in to comment.