Fix #47: add mock http server for testing w/o hitting prod site

This commit is contained in:
2024-01-22 18:25:02 +01:00
parent a94ef63a90
commit ec8f0fcac9
11 changed files with 125 additions and 0 deletions

13
t/httproot/templates/render.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh -x
base="../kleinanzeigen"
mkdir -p $base
echo "Generating /s-bestandsliste.html"
p2cli -t index.tpl -i vars.yaml > $base/s-bestandsliste.html
for idx in 0 1; do
slug=$(cat vars.yaml | yq ".ads[$idx].slug")
id=$(cat vars.yaml | yq ".ads[$idx].id")
mkdir -p $base/$slug/$id
cat vars.yaml | yq ".ads[$idx]" | p2cli -t ad.tpl -f yaml > $base/$slug/$id/index.html
done