Skip to content

Commit acdc860

Browse files
authored
Merge pull request #6548 from phil-hands/add_docs
Add docs: man pages and systemd Documentation= settings
2 parents b3da736 + 4bec032 commit acdc860

File tree

7 files changed

+91
-4
lines changed

7 files changed

+91
-4
lines changed

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,38 @@ help:
6060
@sed -n 's/\(^[^.#[:space:]A-Z]*\):.*$$/\1/p' Makefile | uniq
6161
@echo See docs/Contributing.asciidoc for more details
6262

63+
man_names = openqa-cli openqa-client openqa-load-templates openqa-dump-templates openqa-clone-job openqa-validate-yaml openqa-label-all
64+
manpages = $(addprefix $(man_dir)/,$(addsuffix .1,$(man_names)))
65+
man_dir = build/man1
66+
67+
$(man_dir):
68+
mkdir -p $@
69+
70+
define run-pod2man =
71+
pod2man --errors=stderr --section=1 \
72+
--center "openQA Documentation" \
73+
--name=$(notdir $(basename $@)) $< $@
74+
endef
75+
76+
$(man_dir)/openqa-label-all.1: script/openqa-label-all
77+
argparse-manpage --pyfile $< --function get_parser --author "various authors:" --author-email "https://progress.opensuse.org/projects/openqav3" --project-name openqa --url "https://github.com/os-autoinst/openQA" | grep -v '^\.br$$' >$@
78+
79+
$(man_dir)/openqa-%.1 $(man_dir)/%.1: script/%
80+
$(run-pod2man)
81+
82+
$(man_dir)/openqa-%-templates.1: script/%_templates
83+
$(run-pod2man)
84+
85+
$(man_dir)/openqa-cli.1: lib/OpenQA/CLI.pm
86+
$(run-pod2man)
87+
88+
.PHONY: build-manpages
89+
build-manpages: $(man_dir) $(manpages)
90+
91+
.PHONY: clean
92+
clean:
93+
-rm -r build
94+
6395
.PHONY: install-generic
6496
install-generic:
6597
./tools/generate-packed-assets

dependencies.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ assetpack_requires:
2727

2828
build_requires:
2929
perl(CSS::Sass):
30+
python3-argparse-manpage:
3031
npm:
3132
'%assetpack_requires':
3233

dist/rpm/openQA.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
%define build_requires %assetpack_requires npm rubygem(sass) >= 3.7.4
7575
%else
7676
# The following line is generated from dependencies.yaml
77-
%define build_requires %assetpack_requires npm perl(CSS::Sass)
77+
%define build_requires %assetpack_requires npm perl(CSS::Sass) python3-argparse-manpage
7878
%endif
7979

8080
# All requirements needed by the tests executed during build-time.

script/openqa-label-all

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ class CustomFormatter(
2121

2222
pass
2323

24-
25-
def parse_args():
24+
def get_parser():
2625
parser = argparse.ArgumentParser(
27-
description=__doc__, formatter_class=CustomFormatter
26+
prog='openqa-label-all',
27+
description=""".B openqa-label-all
28+
allows comments to be applied to a set jobs, which match the specified options, on the specified server.""",
29+
formatter_class=CustomFormatter
2830
)
2931
parser.add_argument(
3032
"-v",
@@ -61,6 +63,10 @@ def parse_args():
6163
action="store_true",
6264
help="Do not restart the jobs after labelling",
6365
)
66+
return parser
67+
68+
def parse_args():
69+
parser = get_parser()
6470
args = parser.parse_args()
6571
verbose_to_log = {
6672
0: logging.CRITICAL,

script/openqa-validate-yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,52 @@
1919
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
# SOFTWARE.
2121

22+
=head1 NAME
23+
24+
openqa-validate-yaml - check YAML files against a schema
25+
26+
=head1 SYNOPSIS
27+
28+
openqa-validate-yaml [I<OPTIONS>] [-] [I<file> ...]
29+
30+
=head1 DESCRIPTION
31+
32+
B<openqa-validate-yaml>
33+
should be given a list of one or more filenames.
34+
The files are expected to be YAML files.
35+
B<openqa-validate-yaml>
36+
tests each item in the list to see
37+
if the files are valid when checked against a Schema.
38+
39+
'-' can be specified instead of a filename
40+
to read the test input from STDIN.
41+
42+
=head1 OPTIONS
43+
44+
=over 4
45+
46+
=item B<--validate-schema>
47+
48+
Validate the Schema file itself, in addition to any YAML files.
49+
50+
=item B<--schema-file>=I<SCHEMA>
51+
52+
Specify the schema file or URL to validate against (default .../public/schema/JobTemplates-01.yaml)'],
53+
54+
=item B<-h>
55+
56+
Print a usage message, and exit.
57+
58+
=back
59+
60+
=head1 AUTHOR
61+
62+
This manual page was written by Philip Hands <phil@hands.com>,
63+
for the Debian GNU/Linux system (but may be used by others).
64+
65+
=cut
66+
67+
2268
use strict;
2369
use warnings;
2470
use 5.010;

systemd/openqa-webui.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Description=The openQA web UI
33
Wants=openqa-setup-db.service openqa-livehandler.service openqa-websockets.service openqa-gru.service openqa-enqueue-asset-cleanup.timer openqa-enqueue-result-cleanup.timer openqa-enqueue-bug-cleanup.timer openqa-minion-restart.path
44
After=postgresql.service openqa-setup-db.service nss-lookup.target remote-fs.target apache2.service nginx.service caddy.service
55
Before=openqa-gru.service openqa-scheduler.service openqa-livehandler.service
6+
Documentation=https://open.qa/docs/#_run_the_web_ui
67

78
[Service]
89
User=geekotest

systemd/openqa-worker-plain@.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Description=openQA Worker #%i
77
After=openqa-slirpvde.service network.target nss-lookup.target remote-fs.target time-sync.target
88
PartOf=openqa-worker.target
9+
Documentation=https://open.qa/docs/#_run_openqa_workers
910

1011
[Service]
1112
Type=simple

0 commit comments

Comments
 (0)