Initial TicketTracker release
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
APP_NAME="${APP_NAME:-tickettracker}"
|
||||
GITEA_REGISTRY="${GITEA_REGISTRY:-git.d-razz.de}"
|
||||
GITEA_OWNER="${GITEA_OWNER:-michael}"
|
||||
IMAGE_TAG="${IMAGE_TAG:-latest}"
|
||||
PLATFORM="${PLATFORM:-linux/amd64}"
|
||||
IMAGE="${IMAGE:-${GITEA_REGISTRY}/${GITEA_OWNER}/${APP_NAME}:${IMAGE_TAG}}"
|
||||
|
||||
echo "Baue ${IMAGE} fuer ${PLATFORM}"
|
||||
docker buildx build \
|
||||
--platform "${PLATFORM}" \
|
||||
--tag "${IMAGE}" \
|
||||
--push \
|
||||
.
|
||||
|
||||
echo
|
||||
echo "Image gepusht: ${IMAGE}"
|
||||
echo "Auf dem Docker-Server:"
|
||||
echo " export TICKETTRACKER_IMAGE='${IMAGE}'"
|
||||
echo " docker compose --env-file .env.docker-external -f compose.yml up -d"
|
||||
echo "oder mit PostgreSQL 17 im Stack:"
|
||||
echo " docker compose --env-file .env.docker-postgres -f compose.postgres.yml up -d"
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO_NAME="${REPO_NAME:-tickettracker}"
|
||||
GITEA_HOST="${GITEA_HOST:-git.d-razz.de}"
|
||||
GITEA_USER="${GITEA_USER:-michael}"
|
||||
REMOTE_NAME="${REMOTE_NAME:-origin}"
|
||||
REMOTE_URL="${REMOTE_URL:-git@${GITEA_HOST}:${GITEA_USER}/${REPO_NAME}.git}"
|
||||
|
||||
if [[ ! -d .git ]]; then
|
||||
git init
|
||||
fi
|
||||
|
||||
if git remote get-url "${REMOTE_NAME}" >/dev/null 2>&1; then
|
||||
git remote set-url "${REMOTE_NAME}" "${REMOTE_URL}"
|
||||
else
|
||||
git remote add "${REMOTE_NAME}" "${REMOTE_URL}"
|
||||
fi
|
||||
|
||||
git add .
|
||||
|
||||
if git diff --cached --quiet; then
|
||||
echo "Keine neuen Änderungen zum Committen."
|
||||
else
|
||||
git commit -m "${COMMIT_MESSAGE:-Initial TicketTracker release}"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Remote ist gesetzt auf:"
|
||||
echo " ${REMOTE_URL}"
|
||||
echo
|
||||
echo "Wenn das Repository in Gitea existiert und dein SSH-Key hinterlegt ist:"
|
||||
echo " git push -u ${REMOTE_NAME} main"
|
||||
echo
|
||||
echo "Falls dein lokaler Branch master heisst:"
|
||||
echo " git branch -M main"
|
||||
echo " git push -u ${REMOTE_NAME} main"
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
FRONTEND_PORT="${PORT:-3000}"
|
||||
BACKEND_PORT="${BACKEND_PORT:-3001}"
|
||||
export SERVE_FRONTEND="${SERVE_FRONTEND:-false}"
|
||||
export API_PROXY_TARGET="${API_PROXY_TARGET:-http://127.0.0.1:${BACKEND_PORT}}"
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
cleanup() {
|
||||
if [[ -n "${BACKEND_PID:-}" ]]; then
|
||||
kill "${BACKEND_PID}" 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
PORT="${BACKEND_PORT}" npm run start --workspace backend &
|
||||
BACKEND_PID=$!
|
||||
|
||||
PORT="${FRONTEND_PORT}" npm run start --workspace frontend
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
APP_PORT="${APP_PORT:-3910}"
|
||||
BACKEND_PORT="${BACKEND_PORT:-3001}"
|
||||
export API_PROXY_TARGET="${API_PROXY_TARGET:-http://127.0.0.1:${BACKEND_PORT}}"
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
if [[ -f ".env" ]]; then
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
fi
|
||||
|
||||
if [[ -z "${DATABASE_URL:-}" ]]; then
|
||||
echo "DATABASE_URL fehlt. Beispiel:"
|
||||
echo " export DATABASE_URL='postgresql://user:pass@localhost:5432/tickettracker'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NODE_MAJOR="$(node -p 'Number(process.versions.node.split(".")[0])' 2>/dev/null || echo 0)"
|
||||
|
||||
if [[ "${NODE_MAJOR}" -lt 20 ]]; then
|
||||
echo "Das Next/shadcn-Framework braucht lokal Node >= 20.9, empfohlen Node 22."
|
||||
echo "Aktuell ist Node ${NODE_MAJOR:-unbekannt} aktiv."
|
||||
echo "Es wird kein Docker-Container gebaut oder gestartet."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
npm run build
|
||||
|
||||
cleanup() {
|
||||
if [[ -n "${BACKEND_PID:-}" ]]; then
|
||||
kill "${BACKEND_PID}" 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
echo "Starte Backend auf Port ${BACKEND_PORT}"
|
||||
SERVE_FRONTEND=false PORT="${BACKEND_PORT}" npm run start --workspace backend &
|
||||
BACKEND_PID=$!
|
||||
|
||||
echo "Starte Frontend auf http://localhost:${APP_PORT}"
|
||||
PORT="${APP_PORT}" npm run start --workspace frontend
|
||||
Reference in New Issue
Block a user