From 78c47cba044498ec33f524d0e4167285e7c71dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Tue, 15 Dec 2020 16:58:09 +0000 Subject: [PATCH] chore: checks_basic: verify that autogenerated doc is up to date --- .github/workflows/tests_basic.yml | 15 +++++++++++++-- doc/sphinx/Makefile | 6 ++++-- doc/sphinx/build-plugins-help.sh | 4 ++-- doc/sphinx/plugins/index.rst | 4 ++-- doc/sphinx/plugins/open/clush.rst | 2 +- doc/sphinx/plugins/open/index.rst | 2 +- doc/sphinx/plugins/restricted/index.rst | 4 ++-- doc/sphinx/plugins/restricted/realmInfo.rst | 2 +- .../plugins/restricted/selfAddPersonalAccess.rst | 4 ++-- 9 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests_basic.yml b/.github/workflows/tests_basic.yml index 87cd11d..cbf8518 100644 --- a/.github/workflows/tests_basic.yml +++ b/.github/workflows/tests_basic.yml @@ -4,12 +4,12 @@ on: [push, pull_request] jobs: test: - name: perlcritic, perltidy & shellcheck + name: perlcritic, perltidy, shellcheck, doc runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - name: install prerequisites - run: sudo apt update && sudo apt install -y shellcheck libperl-critic-perl perltidy + run: sudo ./bin/admin/packages-check.sh -i -d env: DEBIAN_FRONTEND: noninteractive - name: shellcheck @@ -18,3 +18,14 @@ jobs: run: bin/dev/perl-critic.sh - name: perl tidy run: bin/dev/perl-tidy.sh test + - name: autogenerate documentation + run: make -C doc/sphinx autogenerated + - name: verify git diff + run: | + if [ "$(git diff --numstat | wc -l)" != 0 ]; then + git diff + echo + echo "Some autogenerated documentation files are not up to date." >&2 + echo "Please run 'make -C doc/sphinx autogenerated' and commit the result." >&2 + exit 1 + fi diff --git a/doc/sphinx/Makefile b/doc/sphinx/Makefile index 586411c..e8da17b 100644 --- a/doc/sphinx/Makefile +++ b/doc/sphinx/Makefile @@ -10,7 +10,9 @@ BUILDDIR = _build VERSION_FILES = conf.py installation/basic.rst VERSION := $(shell perl -e 'require "../../lib/perl/OVH/Bastion.pm"; print $$OVH::Bastion::VERSION') -all: plugins default +all: autogenerated default + +autogenerated: plugins default: Makefile @sed -i -e "s/__VERSION__/$(VERSION)/g" $(VERSION_FILES) @@ -25,7 +27,7 @@ help: plugins: @bash build-plugins-help.sh -.PHONY: help Makefile plugins all +.PHONY: help Makefile plugins all autogenerated default # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/doc/sphinx/build-plugins-help.sh b/doc/sphinx/build-plugins-help.sh index 5b85068..be4fee9 100644 --- a/doc/sphinx/build-plugins-help.sh +++ b/doc/sphinx/build-plugins-help.sh @@ -67,7 +67,7 @@ cat >>"$pluginindex" <> "$indexfile" done diff --git a/doc/sphinx/plugins/index.rst b/doc/sphinx/plugins/index.rst index 734598e..dc8019e 100644 --- a/doc/sphinx/plugins/index.rst +++ b/doc/sphinx/plugins/index.rst @@ -5,8 +5,8 @@ Bastion plugins .. toctree:: admin/index.rst + group-aclkeeper/index.rst group-gatekeeper/index.rst - restricted/index.rst group-owner/index.rst open/index.rst - group-aclkeeper/index.rst + restricted/index.rst diff --git a/doc/sphinx/plugins/open/clush.rst b/doc/sphinx/plugins/open/clush.rst index 0fb9d85..2e16dd1 100644 --- a/doc/sphinx/plugins/open/clush.rst +++ b/doc/sphinx/plugins/open/clush.rst @@ -24,7 +24,7 @@ Launch a remote command on several machines sequentially (clush-like) .. option:: --no-pause-on-failure - Don't pause if the remote command doesn't return failed (returned != 0) + Don't pause if the remote command failed (returned exit code != 0) .. option:: --no-confirm diff --git a/doc/sphinx/plugins/open/index.rst b/doc/sphinx/plugins/open/index.rst index cf4ffda..3697f24 100644 --- a/doc/sphinx/plugins/open/index.rst +++ b/doc/sphinx/plugins/open/index.rst @@ -8,8 +8,8 @@ open plugins batch clush groupInfo - groupListPasswords groupList + groupListPasswords groupListServers help info diff --git a/doc/sphinx/plugins/restricted/index.rst b/doc/sphinx/plugins/restricted/index.rst index 7edc0d1..6588e48 100644 --- a/doc/sphinx/plugins/restricted/index.rst +++ b/doc/sphinx/plugins/restricted/index.rst @@ -6,16 +6,16 @@ restricted plugins accountAddPersonalAccess accountCreate - accountDelete accountDelPersonalAccess + accountDelete accountGeneratePassword accountGrantCommand accountInfo + accountList accountListAccesses accountListEgressKeys accountListIngressKeys accountListPasswords - accountList accountMFAResetPassword accountMFAResetTOTP accountModify diff --git a/doc/sphinx/plugins/restricted/realmInfo.rst b/doc/sphinx/plugins/restricted/realmInfo.rst index c9213cf..deb2b32 100644 --- a/doc/sphinx/plugins/restricted/realmInfo.rst +++ b/doc/sphinx/plugins/restricted/realmInfo.rst @@ -3,7 +3,7 @@ realmInfo ========== Display information about a bastion realm -========================================== +========================================= .. admonition:: usage diff --git a/doc/sphinx/plugins/restricted/selfAddPersonalAccess.rst b/doc/sphinx/plugins/restricted/selfAddPersonalAccess.rst index 69e46c1..470d28d 100644 --- a/doc/sphinx/plugins/restricted/selfAddPersonalAccess.rst +++ b/doc/sphinx/plugins/restricted/selfAddPersonalAccess.rst @@ -2,8 +2,8 @@ selfAddPersonalAccess ====================== -Remove a personal server access from an account -=============================================== +Add a personal server access on your account +============================================ .. admonition:: usage