#!/bin/sh # Holt die Deployment-Dateien in ein neues Projekt. # # sh bootstrap.sh # # Vorhandene Dateien werden nicht ueberschrieben, nur fehlende angelegt. # Bei privatem Repo: DEPLOY_KIT_TOKEN= vorher setzen. set -eu BASE="${DEPLOY_KIT_BASE:-https://gitea.lucas-orth.de/lucas.orth/deploy-kit/raw/branch/main}" APP="${1:-}" PORT="${2:-}" if [ -z "$APP" ] || [ -z "$PORT" ]; then echo "Aufruf: sh bootstrap.sh " >&2 echo "Beispiel: sh bootstrap.sh busyfeed 8080" >&2 exit 1 fi fetch() { remote="$1" local_path="$2" if [ -e "$local_path" ]; then echo " uebersprungen, existiert: $local_path" return 0 fi dir=$(dirname "$local_path") [ "$dir" = "." ] || mkdir -p "$dir" if [ -n "${DEPLOY_KIT_TOKEN:-}" ]; then curl -fsSL -H "Authorization: token $DEPLOY_KIT_TOKEN" "$BASE/$remote" -o "$local_path" else curl -fsSL "$BASE/$remote" -o "$local_path" fi echo " angelegt: $local_path" } fetch DEPLOY.md DEPLOY.md fetch template/docker-compose.yml docker-compose.yml fetch template/.gitea/workflows/deploy.yml .gitea/workflows/deploy.yml fetch template/.dockerignore .dockerignore fetch template/Dockerfile Dockerfile for f in docker-compose.yml Dockerfile; do [ -f "$f" ] && sed -i "s/__APP__/$APP/g; s/__PORT__/$PORT/g" "$f" done cat < $APP:$PORT Konventionen und Fallstricke: DEPLOY.md Damit Claude sie liest, in CLAUDE.md eine Zeile ergaenzen: Deployment-Konventionen stehen in DEPLOY.md. Vor Aenderungen an Dockerfile, docker-compose.yml oder Workflows dort nachsehen. EOF