scripts/po-tasks/migrate task added to migrate and validate configuration using kresctl
- poetry install --all-extras --only main,dev
- poe examples
+python:migrate:
+ <<: *python
+ script:
+ - poetry install --all-extras --only main,dev
+ - poe migrate
+
python:check:
<<: *python
script:
-
cache:
- # garbage-collector: false
garbage-collector:
interval: 2s
-# dns64: true
dns64:
rev-ttl: 1d
-# dnssec: false
dnssec:
refresh-time: 10m
hold-down-time: 30d
assertion-fork: 5m
monitoring:
- # graphite: false
+ enabled: always
graphite:
host: 127.0.0.1
--- /dev/null
+
+cache:
+ garbage-collector: false
+
+dns64: true
+
+dnssec: false
+
+monitoring:
+ graphite: false
format = { cmd = "scripts/poe-tasks/format", help = "Check and fix code formatting using Ruff." }
kresctl = { cmd = "scripts/poe-tasks/kresctl", help="Run kresctl utility" }
clean = { cmd = "scripts/poe-tasks/clean", help="Cleanup build directories and files" }
+migrate = { cmd = "scripts/poe-tasks/migrate", help = "Migrate testing configuration using 'kresctl migrate' utility and validate it" }
[tool.ruff]
line-length = 120
check_rv $?
echo
-# check etc/config/config.migrate.yaml
-echo -e "${yellow}Checking etc/config/config.migrate.yaml${reset}"
-python -m knot_resolver.client migrate etc/config/config.migrate.yaml > /dev/null
-check_rv $?
-echo
-
# fancy messages at the end :)
fancy_message
--- /dev/null
+#!/usr/bin/env bash
+
+# ensure consistent behaviour
+src_dir="$(dirname "$(realpath "$0")")"
+source $src_dir/utils/_env.sh
+
+# stop failing early, because we wouldn't do anything else than fail
+set +e
+
+# migrate all testing configuration
+for config in $PWD/etc/config/config.migrate-test*.yaml;
+do
+ python3 -m knot_resolver.client migrate $config migrated.yaml;
+ python3 -m knot_resolver.client validate --no-strict migrated.yaml;
+ check_rv $?
+done