diff --git a/manager/.gitlab-ci.yml b/manager/.gitlab-ci.yml index 60d8b361ada498ac0444672ade0004dd948ba53a..c709e733bde4a589387f46d80ef4a9ff30381f3a 100644 --- a/manager/.gitlab-ci.yml +++ b/manager/.gitlab-ci.yml @@ -12,6 +12,14 @@ default: - linux - amd64 +examples:py3.11: + stage: check + script: + - poetry install --only main,dev + - poe examples + variables: + PYTHON_INTERPRETER: python3.11 + lint:py3.11: stage: check script: @@ -20,7 +28,6 @@ lint:py3.11: variables: PYTHON_INTERPRETER: python3.11 - .unit: &unit stage: check script: diff --git a/manager/pyproject.toml b/manager/pyproject.toml index 03cb2ac7f257b657c7a82e0fb951a0cb55a42ba1..e9615b7dc363d00fcec3609e625b186f9ba73e7f 100644 --- a/manager/pyproject.toml +++ b/manager/pyproject.toml @@ -68,6 +68,7 @@ format = { shell = "black knot_resolver_manager/ tests/ scripts/ build.py; isort fixdeps = { shell = "poetry install; npm install; npm update", help = "Install/update dependencies according to configuration files"} commit = { shell = "scripts/commit", help = "Invoke every single check before commiting" } container = { cmd = "scripts/container.py", help = "Manage containers" } +examples = { cmd = "scripts/examples", help = "Validate all configuration examples" } kresctl = { script = "knot_resolver_manager.cli.main:main", cwd="${POE_PWD}", help="run kresctl" } kresctl-nocwd = { script = "knot_resolver_manager.cli.main:main", help="run kresctl" } # Python <3.8 and poethepoet <0.22.0 compatibility (see also `./poe`) clean = """ diff --git a/manager/scripts/examples b/manager/scripts/examples new file mode 100755 index 0000000000000000000000000000000000000000..a5de766eb5c7f4f1fa3f99b9d069f0034639b5db --- /dev/null +++ b/manager/scripts/examples @@ -0,0 +1,11 @@ +#!/bin/bash + +# ensure consistent behaviour +src_dir="$(dirname "$(realpath "$0")")" +source $src_dir/_env.sh + +# validate all configuration examples +for example in $PWD/etc/knot-resolver/config.example.*.yaml; +do + poe kresctl validate --no-strict $example; +done