From 5b4a5030014b46507145478b213914faf17f9872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 7 May 2020 08:44:45 +0200 Subject: [PATCH 1/7] Specificy 'rolling-release' policy --- CHANGELOG.md | 6 ++---- README.md | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cd9255..d2ebad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,3 @@ -# cdist-contrib chsangelog +# cdist-contrib changes -## 2020-0?-??: 0.?.? (Not released yet) - -* New type: __find_exec (Ander Punnar) +* 2020-04-28: New type: __find_exec (Ander Punnar) diff --git a/README.md b/README.md index 7dcd73f..75f6411 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ tool with community-maitained types which are either too specific to fit/be maintained in cdist itself or were not accepted in code cdist but could still be useful. -The releases of cdist-contrib are not necessarly synced with cdist itself. +This project does not have releases and is continously updated: see +`CHANGELOG.md` for details. ## Using cdist-contrib From 9ecffb618d3ef404ee0b0a19277281c2e1e9c7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 7 May 2020 08:45:21 +0200 Subject: [PATCH 2/7] Add CONTIBUTING section to README --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 75f6411..4b8dd09 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,16 @@ Join us on [#cdist:ungleich.ch][cdistmatrix] on matrix or on [cdistconfig]: https://www.cdi.st/manual/latest/cdist-configuration.html [cdistmatrix]: https://matrix.to/#/#cdist:ungleich.ch [cdistmattermost]: https://chat.ungleich.ch/ungleich/channels/cdist + +## Contributing + +The preferred way to submit patches is by opening Merge Requests against the +[cdist-contrib project on +code.ungleich.ch](https://code.ungleich.ch/ungleich-public/cdist-contrib) (you +can make an account on +[account.ungleich.ch](https://code.ungleich.ch/ungleich-public/cdist-contrib). + +Every type in cdist-contrib must: + + * Have a `man.rst` documentation page. + * Pass [shellcheck](https://duckduckgo.com/?q=shellcheck&ia=software) without errors. From 88661eb6f37f2a1015f3289c5ba656ffc2b15a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 7 May 2020 08:59:14 +0200 Subject: [PATCH 3/7] Add run-shellcheck helper --- run-shellcheck.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 run-shellcheck.sh diff --git a/run-shellcheck.sh b/run-shellcheck.sh new file mode 100755 index 0000000..c0532e0 --- /dev/null +++ b/run-shellcheck.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +SHELLCHECKCMD="shellcheck -s sh -f gcc -x" +# Skip SC2154 for variables starting with __ since such variables are cdist +# environment variables. +SHELLCHECK_SKIP=': __.*is referenced but not assigned.*\[SC2154\]' +SHELLCHECKTMP=".shellcheck.tmp" + +check () { + find type/ -type f $1 $2 -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" > "${SHELLCHECKTMP}" + test ! -s "${SHELLCHECKTMP}" || { cat "${SHELLCHECKTMP}"; exit 1; } +} + +check -path "*/explorer/*" +check -path "*/files/*" +check -name manifest +check -name gencode-local +check -name gencode-remote From 898b6a20b08e81a4acc8b856ab0e8a6faa8ba21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 7 May 2020 09:36:27 +0200 Subject: [PATCH 4/7] Move run-shellcheck to scripts/ --- run-shellcheck.sh => scripts/run-shellcheck.sh | 3 +++ 1 file changed, 3 insertions(+) rename run-shellcheck.sh => scripts/run-shellcheck.sh (89%) diff --git a/run-shellcheck.sh b/scripts/run-shellcheck.sh similarity index 89% rename from run-shellcheck.sh rename to scripts/run-shellcheck.sh index c0532e0..769f853 100755 --- a/run-shellcheck.sh +++ b/scripts/run-shellcheck.sh @@ -6,6 +6,9 @@ SHELLCHECKCMD="shellcheck -s sh -f gcc -x" SHELLCHECK_SKIP=': __.*is referenced but not assigned.*\[SC2154\]' SHELLCHECKTMP=".shellcheck.tmp" +# Move to top-level cdist-contrib directory. +cd $(dirname $0)/.. + check () { find type/ -type f $1 $2 -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" > "${SHELLCHECKTMP}" test ! -s "${SHELLCHECKTMP}" || { cat "${SHELLCHECKTMP}"; exit 1; } From 66bf91f2e9fb6a656962dfed52b55e733fae551a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 7 May 2020 09:36:43 +0200 Subject: [PATCH 5/7] Add scripts/run-manpage-checks.sh --- scripts/run-manpage-checks.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/run-manpage-checks.sh diff --git a/scripts/run-manpage-checks.sh b/scripts/run-manpage-checks.sh new file mode 100755 index 0000000..828179b --- /dev/null +++ b/scripts/run-manpage-checks.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Move to top-level cdist-contrib directory. +cd $(dirname $0)/.. + +# Check that each type has a man page. +status=0 +for t in type/*; do + if [ ! -f "$t/man.rst" ]; then + echo "No manpage for type $t!" + status=1 + fi +done + +exit $status From 7747f87536efaa3253dfda71d88eaba8107de782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 7 May 2020 09:29:03 +0200 Subject: [PATCH 6/7] Add basic CI configuration --- .gitignore | 1 + .gitlab-ci.yml | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .gitignore create mode 100644 .gitlab-ci.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb8a3c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.shellcheck.tmp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..dba7864 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,14 @@ +stages: + - test + +image: code.ungleich.ch:5050/ungleich-public/cdist/cdist-ci:latest + +shellcheck: + stage: test + script: + - ./scripts/run-shellcheck.sh + +manpages: + stage: test + script: + - ./scripts/run-manpage-checks.sh From c6da87d3dc2109a744d2018bcf5ebecf293aa679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Fri, 8 May 2020 11:20:29 +0200 Subject: [PATCH 7/7] README: update links in CONTRIBUTING section --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4b8dd09..ef4b2c3 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,9 @@ The preferred way to submit patches is by opening Merge Requests against the [cdist-contrib project on code.ungleich.ch](https://code.ungleich.ch/ungleich-public/cdist-contrib) (you can make an account on -[account.ungleich.ch](https://code.ungleich.ch/ungleich-public/cdist-contrib). +[account.ungleich.ch](https://account.ungleich.ch/). Every type in cdist-contrib must: * Have a `man.rst` documentation page. - * Pass [shellcheck](https://duckduckgo.com/?q=shellcheck&ia=software) without errors. + * Pass [shellcheck](http://shellcheck.net/) without errors.