From a270df72e831858c1c26a9636d982538a4683180 Mon Sep 17 00:00:00 2001 From: webfarben Date: Tue, 23 Jun 2026 11:33:54 +0200 Subject: [PATCH] Add backup workflow --- .gitignore | 3 ++- README.md | 23 +++++++++++++++++++++++ scripts/create-backup.sh | 25 +++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 README.md create mode 100755 scripts/create-backup.sh diff --git a/.gitignore b/.gitignore index 7bedd6a..64c3d14 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ Thumbs.db *~ *.swp -*.swo \ No newline at end of file +*.swo +backups/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5147057 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Ruhepunkt + +Statische Website ohne Build-Prozess. Alle auslieferbaren Dateien liegen direkt im Repository. + +## Backup-Workflow + +Ein versioniertes Backup der aktuellen Git-Version kann so erstellt werden: + +```bash +./scripts/create-backup.sh +``` + +Optional kann ein eigenes Zielverzeichnis uebergeben werden: + +```bash +./scripts/create-backup.sh /pfad/zum/backup-ordner +``` + +Das Skript erzeugt ein komprimiertes Archiv aus dem aktuellen `HEAD` und legt es standardmaessig unter `backups/` ab. + +## Deployment + +Da es sich um eine statische Seite handelt, ist ein Deployment per Upload oder `rsync` grundsaetzlich einfach moeglich. Fuer eine automatische Deployment-Konfiguration fehlen im Repository aktuell aber noch die Zielinformationen, etwa Server, Pfad und Zugangsmethode. \ No newline at end of file diff --git a/scripts/create-backup.sh b/scripts/create-backup.sh new file mode 100755 index 0000000..9d54e3b --- /dev/null +++ b/scripts/create-backup.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo_root="$(cd "$(dirname "$0")/.." && pwd)" +output_dir="${1:-$repo_root/backups}" + +if ! git -C "$repo_root" rev-parse --is-inside-work-tree >/dev/null 2>&1; then + echo "Kein Git-Repository gefunden: $repo_root" >&2 + exit 1 +fi + +mkdir -p "$output_dir" + +timestamp="$(date +%Y%m%d-%H%M%S)" +short_sha="$(git -C "$repo_root" rev-parse --short HEAD)" +archive_name="ruhepunkt-${timestamp}-${short_sha}.tar.gz" +archive_path="$output_dir/$archive_name" + +git -C "$repo_root" archive \ + --format=tar.gz \ + --output="$archive_path" \ + HEAD + +echo "Backup erstellt: $archive_path" \ No newline at end of file