Westreiche: Vault, Werkzeuge und Website
Neuinitialisierung ohne den PDF-Ballast (Regelwerke/Abenteuer/Magazine liegen auf dem Server, siehe tools/pdf_sync.py und tools/pdf_manifest.json). Vorherige Historie bewusst verworfen.
This commit is contained in:
commit
2dd6295caf
611 changed files with 100926 additions and 0 deletions
44
tools/deploy_web.sh
Executable file
44
tools/deploy_web.sh
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env bash
|
||||
# Lädt den gebauten Webauftritt (web/) per explizitem FTPS nach public_html/.
|
||||
# Voraussetzung: `python3 tools/build_site.py` wurde ausgeführt.
|
||||
#
|
||||
# Aufruf: ./tools/deploy_web.sh [--dry-run]
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
[ -f credentials.txt ] || { echo "credentials.txt fehlt" >&2; exit 1; }
|
||||
[ -d web ] || { echo "web/ fehlt – erst tools/build_site.py ausführen" >&2; exit 1; }
|
||||
|
||||
set -a; . ./credentials.txt; set +a
|
||||
|
||||
DRY=0
|
||||
[ "${1:-}" = "--dry-run" ] && DRY=1
|
||||
|
||||
TARGET="public_html"
|
||||
|
||||
upload() {
|
||||
local src="$1" dst="$2"
|
||||
if [ "$DRY" = 1 ]; then
|
||||
echo "would upload $src -> ftp://$FTP_URL/$dst"
|
||||
return
|
||||
fi
|
||||
curl -s -S --ssl-reqd --ftp-create-dirs --max-time 120 --user "$FTP_USER:$FTP_PASSWORD" \
|
||||
-T "$src" "ftp://$FTP_URL/$dst" || { echo "FEHLER: $src" >&2; return 1; }
|
||||
echo "ok $dst"
|
||||
}
|
||||
|
||||
# Einzeldateien (nur was gebaut wurde – weltenauge.php fehlt, solange das
|
||||
# Projekt ruht; siehe SHOW_WELTENAUGE in tools/build_site.py)
|
||||
for f in index.php weltenauge.php; do
|
||||
[ -f "web/$f" ] || continue
|
||||
upload "web/$f" "$TARGET/$f"
|
||||
done
|
||||
|
||||
# assets/ und westreiche/ rekursiv
|
||||
while IFS= read -r -d '' file; do
|
||||
rel="${file#web/}"
|
||||
upload "$file" "$TARGET/$rel"
|
||||
done < <(find web/assets web/westreiche -type f -print0 | sort -z)
|
||||
|
||||
echo "Deploy abgeschlossen ($([ "$DRY" = 1 ] && echo "dry-run" || echo "live"))."
|
||||
Loading…
Add table
Add a link
Reference in a new issue