From d2f70d85b4cdb558d4d8b7ba7cc6015449723da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Tue, 13 Oct 2020 09:28:40 +0200 Subject: [PATCH] Initial structure, tooling, README and LICENSE --- LICENSE | 15 +++++++++++++++ README.md | 10 ++++++++++ scripts/run-manpage-checks.sh | 15 +++++++++++++++ scripts/run-shellcheck.sh | 21 +++++++++++++++++++++ type/.keep | 0 5 files changed, 61 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100755 scripts/run-manpage-checks.sh create mode 100755 scripts/run-shellcheck.sh create mode 100644 type/.keep diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2129ccf --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +Recycled Cloud CDIST types +Copyright (C) 2020 Timothée Floure / e-Durable SA + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/README.md b/README.md new file mode 100644 index 0000000..d4a6e50 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Recycled Cloud CDIST types + +The repository contains [cdist](https://www.cdi.st/) types used to define the +recycled cloud infrastructure. They usually are called from the +[cdist-workdir](https://code.recycled.cloud/e-Durable/cdist-workdir) +repository. You can refer to the [Recycled Cloud +documentation](https://wiki.recycled.cloud/en/recycled_cloud/home) for details. + +Unless specified otherwise, the content of this repository is licensed under +the GPLv3. 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 diff --git a/scripts/run-shellcheck.sh b/scripts/run-shellcheck.sh new file mode 100755 index 0000000..475f426 --- /dev/null +++ b/scripts/run-shellcheck.sh @@ -0,0 +1,21 @@ +#!/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" + +# 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; } +} + +check -path "*/explorer/*" +check -path "*/files/*.sh" +check -name manifest +check -name gencode-local +check -name gencode-remote diff --git a/type/.keep b/type/.keep new file mode 100644 index 0000000..e69de29