From: Aleš Mrázek Date: Thu, 22 May 2025 12:57:42 +0000 (+0200) Subject: .gitlab-ci.yml: added python:migrate X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72e1bb6f4d91173a07ed6b3b1dbfd42f91c14da6;p=thirdparty%2Fknot-resolver.git .gitlab-ci.yml: added python:migrate scripts/po-tasks/migrate task added to migrate and validate configuration using kresctl --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 16917bb11..a69fe33d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -857,6 +857,12 @@ python:examples: - 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: diff --git a/etc/config/config.migrate.yaml b/etc/config/config.migrate-test.yaml similarity index 89% rename from etc/config/config.migrate.yaml rename to etc/config/config.migrate-test.yaml index 9cd490fe0..ccb1fadb8 100644 --- a/etc/config/config.migrate.yaml +++ b/etc/config/config.migrate-test.yaml @@ -1,14 +1,10 @@ - cache: - # garbage-collector: false garbage-collector: interval: 2s -# dns64: true dns64: rev-ttl: 1d -# dnssec: false dnssec: refresh-time: 10m hold-down-time: 30d @@ -32,7 +28,7 @@ logging: assertion-fork: 5m monitoring: - # graphite: false + enabled: always graphite: host: 127.0.0.1 diff --git a/etc/config/config.migrate-test2.yaml b/etc/config/config.migrate-test2.yaml new file mode 100644 index 000000000..2b309be67 --- /dev/null +++ b/etc/config/config.migrate-test2.yaml @@ -0,0 +1,10 @@ + +cache: + garbage-collector: false + +dns64: true + +dnssec: false + +monitoring: + graphite: false diff --git a/pyproject.toml b/pyproject.toml index 6bd77adc6..673de37eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,6 +84,7 @@ gen-setuppy = { cmd = "scripts/poe-tasks/gen-setuppy", help = "Generate 'setup.p 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 diff --git a/scripts/poe-tasks/check b/scripts/poe-tasks/check index f5033f174..76da1209a 100755 --- a/scripts/poe-tasks/check +++ b/scripts/poe-tasks/check @@ -41,12 +41,6 @@ python -m knot_resolver.client schema | diff - doc/_static/config.schema.json 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 diff --git a/scripts/poe-tasks/migrate b/scripts/poe-tasks/migrate new file mode 100755 index 000000000..6ce030374 --- /dev/null +++ b/scripts/poe-tasks/migrate @@ -0,0 +1,16 @@ +#!/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