Initial repository structure
This commit is contained in:
commit
4b7b9ab503
5 changed files with 71 additions and 0 deletions
14
.gitlab-ci.yml
Normal file
14
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
stages:
|
||||
- test
|
||||
|
||||
image: code.ungleich.ch:5050/ungleich-public/cdist-contrib/ci-container:latest
|
||||
|
||||
shellcheck:
|
||||
stage: test
|
||||
script:
|
||||
- ./scripts/run-shellcheck.sh
|
||||
|
||||
manpages:
|
||||
stage: test
|
||||
script:
|
||||
- ./scripts/run-manpage-checks.sh
|
13
README.md
Normal file
13
README.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# ungleich CDIST types
|
||||
|
||||
The repository contains [cdist](https://www.cdi.st/) types used to define the
|
||||
ungleich infrastructure. They usually are called from the
|
||||
[cdist-workdir](https://code.ungleich.ch/ungleich-intern/cdist-workdir)
|
||||
repository.
|
||||
|
||||
The types in this repository must comply with the
|
||||
[cdist-contrib](https://code.ungleich.ch/ungleich-public/cdist-contrib)
|
||||
guidelines (manpage must be present, shellcheck-compliant, etc.).
|
||||
|
||||
Unless specified otherwise, the content of this repository is licensed under
|
||||
the GPLv3.
|
15
scripts/run-manpage-checks.sh
Executable file
15
scripts/run-manpage-checks.sh
Executable file
|
@ -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
|
29
scripts/run-shellcheck.sh
Executable file
29
scripts/run-shellcheck.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh -eu
|
||||
|
||||
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 "$@" -exec ${SHELLCHECKCMD} {} + \
|
||||
| grep -v "${SHELLCHECK_SKIP}" >>"${SHELLCHECKTMP}" || true
|
||||
}
|
||||
|
||||
rm -f "${SHELLCHECKTMP}"
|
||||
|
||||
check -path '*/explorer/*'
|
||||
check -path '*/files/*' -name '*.sh'
|
||||
check -name manifest
|
||||
check -name gencode-local
|
||||
check -name gencode-remote
|
||||
|
||||
if test -s "${SHELLCHECKTMP}"
|
||||
then
|
||||
cat "${SHELLCHECKTMP}" >&2
|
||||
exit 1
|
||||
fi
|
0
type/.keep
Normal file
0
type/.keep
Normal file
Loading…
Reference in a new issue