echo -e "${red}This command can be run only in a git repository tree.${reset}"
exit 1
fi
-cd $gitroot/manager
+cd $gitroot
# ensure consistent environment with virtualenv
if test -z "$VIRTUAL_ENV" -a "$CI" != "true" -a -z "$KNOT_ENV"; then
# fail even on unbound variables
set -o nounset
-
function build_kresd {
- pushd ..
- if [ -d manager/.build_kresd ]; then
+ if [ -d .build_kresd ]; then
echo
echo Building Knot Resolver
echo ----------------------
echo -e "${blue}In case of an compilation error, run this command to try to fix it:${reset}"
echo -e "\t${blue}rm -r $(realpath .install_kresd) $(realpath .build_kresd)${reset}"
echo
- ninja -C manager/.build_kresd
- ninja install -C manager/.build_kresd
- export PYTHONPATH="$(realpath manager/.build_kresd/python):${PYTHONPATH:-}"
+ ninja -C .build_kresd
+ ninja install -C .build_kresd
+ export PYTHONPATH="$(realpath .build_kresd/python):${PYTHONPATH:-}"
else
echo
echo Knot Resolver daemon is not configured.
echo
exit 2
fi
- popd
}
# check formatting using black
echo -e "${yellow}Checking formatting using black...${reset}"
-black knot_resolver_manager tests scripts --check --diff
+black manager/knot_resolver_manager tests/manager scripts/create_setup.py --check --diff
check_rv $?
echo
# check code with pylint
echo -e "${yellow}Linting using pylint...${reset}"
-pylint knot_resolver_manager
+pylint manager/knot_resolver_manager
check_rv $?
echo
# check code with flake8
echo -e "${yellow}Linting using flake8...${reset}"
-flake8 --ignore=E266,W503 knot_resolver_manager
+flake8 --max-line-length=200 --ignore=E266,W503 --extend-ignore=E203 manager/knot_resolver_manager
check_rv $?
echo
# check types with mypy
echo -e "${yellow}Type checking using mypy...${reset}"
-mypy knot_resolver_manager
+mypy manager/knot_resolver_manager
check_rv $?
echo
# ensure consistent behaviour
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/_env.sh
-cd ..
-echo Building documentation for Knot Resolver
+echo Building Knot Resolver documentation
+echo ------------------------------------
meson build_doc -Ddoc=enabled
ninja -C build_doc doc
source $src_dir/_env.sh
# validate all configuration examples
-for example in $PWD/etc/knot-resolver/config.example.*.yaml;
+for example in $PWD/etc/config/config.example.*.yaml;
do
poe kresctl validate --no-strict $example;
done
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/_env.sh
-pushd ..
reconfigure=''
-if [ -f manager/.build_kresd/ninja.build ]; then
+if [ -f .build_kresd/ninja.build ]; then
reconfigure='--reconfigure'
fi
-meson setup manager/.build_kresd "$reconfigure" --prefix=$(realpath manager/.install_kresd) "$@"
-popd
+meson setup .build_kresd "$reconfigure" --prefix=$(realpath .install_kresd) "$@"
build_kresd
shopt -s globstar
shopt -s nullglob
for d in build/lib*; do
- for f in "$d/"**/*.so; do
- cp -v "$f" ${f#"$d/"}
+ for f in "manager/$d/"**/*.so; do
+ cp -v "$f" ${f#"manager/$d/"}
done
done
shopt -u globstar
echo -------------------------------------------------------
# create runtime directories
-if [ -z "${KRES_MANAGER_RUNTIME:-}" ]; then
- KRES_MANAGER_RUNTIME="etc/knot-resolver"
+if [ -z "${KRES_CONFIG_DIR:-}" ]; then
+ KRES_CONFIG_DIR="etc/config"
fi
-mkdir -p "$KRES_MANAGER_RUNTIME/runtime" "$KRES_MANAGER_RUNTIME/cache"
+mkdir -p "$KRES_CONFIG_DIR/runtime" "$KRES_CONFIG_DIR/cache"
if [ -z "${KRES_MANAGER_CONFIG:-}" ]; then
- KRES_MANAGER_CONFIG="$KRES_MANAGER_RUNTIME/config.dev.yaml"
+ KRES_MANAGER_CONFIG="$KRES_CONFIG_DIR/config.dev.yaml"
fi
if [ -z "${KRES_MANAGER_API_SOCK:-}" ]; then
- KRES_MANAGER_API_SOCK="$KRES_MANAGER_RUNTIME/manager.sock"
+ KRES_MANAGER_API_SOCK="$KRES_CONFIG_DIR/manager.sock"
fi
export KRES_MANAGER_CONFIG