25 lines
765 B
Bash
25 lines
765 B
Bash
|
|
#!/usr/bin/env bash
|
|||
|
|
set -euo pipefail
|
|||
|
|
|
|||
|
|
BASE="${BASE_URL:-http://localhost:8000/import/wiki}"
|
|||
|
|
|
|||
|
|
# 1) Health-Check
|
|||
|
|
echo "? Health-Check<63>"
|
|||
|
|
curl -s -o /dev/null -w '%{http_code}\n' "${BASE}/health"
|
|||
|
|
|
|||
|
|
# 2) Login (damit Session-Cookies gesetzt werden, wenn Du das weiter nutzt)
|
|||
|
|
echo -e "\n? Login<69>"
|
|||
|
|
curl -s -X POST "${BASE}/login" \
|
|||
|
|
-H "Content-Type: application/json" \
|
|||
|
|
-d "{\"username\":\"${WIKI_BOT_USER}\",\"password\":\"${WIKI_BOT_PASSWORD}\"}" | jq
|
|||
|
|
|
|||
|
|
# 3) Import aus Kategorie
|
|||
|
|
echo -e "\n? Importiere <20>bungen aus <20><>bungen<65><6E>"
|
|||
|
|
RESP=$(curl -s -G "${BASE}/import/exercises" \
|
|||
|
|
--data-urlencode "category=<3D>bungen")
|
|||
|
|
echo "$RESP" | jq
|
|||
|
|
|
|||
|
|
# 4) Ergebnis pr<70>fen
|
|||
|
|
IMPORTED=$(echo "$RESP" | jq '.imported | length')
|
|||
|
|
echo -e "\n? Anzahl importierter <20>bungen: $IMPORTED"
|