Compare commits
No commits in common. "720dcc398348f11d0259000d4b239c076b509f5d" and "9d3f902014803b886be21eae19c1b893ddd52b6f" have entirely different histories.
720dcc3983
...
9d3f902014
7 changed files with 14 additions and 100 deletions
62
Makefile
62
Makefile
|
|
@ -4,18 +4,15 @@
|
||||||
# Git wird nur lokal auf dem Mac und für Forgejo-Backup genutzt.
|
# Git wird nur lokal auf dem Mac und für Forgejo-Backup genutzt.
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
|
|
||||||
DS_HOST := ds
|
DS_HOST := ds
|
||||||
DS_IP := 10.47.11.10
|
DS_IP := 10.47.11.10
|
||||||
# Hinweis: NPM braucht 10.47.11.99 als Forward-IP (Macvlan-Shim), nicht .10
|
# Hinweis: NPM braucht 10.47.11.99 als Forward-IP (Macvlan-Shim), nicht .10
|
||||||
DS_SSH_PORT := 4711
|
DS_SSH_PORT := 4711
|
||||||
DS_PATH := /volume1/docker/banyaro
|
DS_PATH := /volume1/docker/banyaro
|
||||||
DS_PATH_STAGING := /volume1/docker/banyaro-staging
|
CONTAINER := banyaro # container_name (für docker logs/exec)
|
||||||
CONTAINER := banyaro
|
SERVICE := banyaro # service-name in docker-compose.yml (für docker compose restart)
|
||||||
CONTAINER_STAGING:= banyaro-staging
|
GIT_REMOTE := origin
|
||||||
SERVICE := banyaro
|
DOCKER := sudo /usr/local/bin/docker
|
||||||
GIT_REMOTE := origin
|
|
||||||
DOCKER := sudo /usr/local/bin/docker
|
|
||||||
VERSION ?= $(shell grep '"version"' backend/static/manifest.json | grep -o '[0-9]*\.[0-9]*\.[0-9]*' | head -1)
|
|
||||||
|
|
||||||
# tar: was NICHT auf die DS übertragen wird
|
# tar: was NICHT auf die DS übertragen wird
|
||||||
TAR_EXCLUDE := --exclude='.git' \
|
TAR_EXCLUDE := --exclude='.git' \
|
||||||
|
|
@ -26,7 +23,7 @@ TAR_EXCLUDE := --exclude='.git' \
|
||||||
--exclude='./*.db' \
|
--exclude='./*.db' \
|
||||||
--exclude='./.DS_Store'
|
--exclude='./.DS_Store'
|
||||||
|
|
||||||
.PHONY: help deploy deploy-clean staging release sync push restart build stop status \
|
.PHONY: help deploy deploy-clean sync push restart build stop status \
|
||||||
logs logs-f shell db dev clean-cache check-ssh
|
logs logs-f shell db dev clean-cache check-ssh
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
@ -109,47 +106,6 @@ deploy-clean: check-ssh
|
||||||
@echo " ✓ Deploy fertig. Letzte Logs:"
|
@echo " ✓ Deploy fertig. Letzte Logs:"
|
||||||
@ssh $(DS_HOST) "$(DOCKER) logs $(CONTAINER) --tail=15"
|
@ssh $(DS_HOST) "$(DOCKER) logs $(CONTAINER) --tail=15"
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# STAGING — develop-Branch auf Staging deployen (Port 3012)
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
staging: check-ssh
|
|
||||||
@echo "→ Git push develop..."
|
|
||||||
@git push $(GIT_REMOTE) develop
|
|
||||||
@echo "→ Sync zu DS (Staging)..."
|
|
||||||
@COPYFILE_DISABLE=1 tar czf - $(TAR_EXCLUDE) . | ssh $(DS_HOST) "tar xzf - -C $(DS_PATH_STAGING)/"
|
|
||||||
@echo "→ Staging rebuild + restart..."
|
|
||||||
@ssh $(DS_HOST) " \
|
|
||||||
cd $(DS_PATH_STAGING) && \
|
|
||||||
$(DOCKER) compose -f docker-compose.staging.yml down && \
|
|
||||||
$(DOCKER) compose -f docker-compose.staging.yml build && \
|
|
||||||
$(DOCKER) compose -f docker-compose.staging.yml up -d"
|
|
||||||
@echo ""
|
|
||||||
@echo " ✓ Staging fertig — https://staging.banyaro.app"
|
|
||||||
@ssh $(DS_HOST) "$(DOCKER) logs $(CONTAINER_STAGING) --tail=10"
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
# RELEASE — develop → main → Production (VERSION= pflichtangabe)
|
|
||||||
# Beispiel: make release VERSION=1.1.0
|
|
||||||
# ----------------------------------------------------------
|
|
||||||
release: check-ssh
|
|
||||||
@if [ -z "$(VERSION)" ]; then \
|
|
||||||
echo "❌ Bitte VERSION setzen: make release VERSION=1.1.0"; exit 1; fi
|
|
||||||
@echo "→ Merge develop → main (v$(VERSION))..."
|
|
||||||
@git checkout main
|
|
||||||
@git merge develop --no-ff -m "Release v$(VERSION)"
|
|
||||||
@sed -i '' 's/"version": "[^"]*"/"version": "$(VERSION)"/' backend/static/manifest.json
|
|
||||||
@git add backend/static/manifest.json
|
|
||||||
@git commit --amend --no-edit
|
|
||||||
@git tag "v$(VERSION)"
|
|
||||||
@git push $(GIT_REMOTE) main --tags
|
|
||||||
@echo "→ Production deployen..."
|
|
||||||
@$(MAKE) deploy
|
|
||||||
@git checkout develop
|
|
||||||
@git merge main
|
|
||||||
@git push $(GIT_REMOTE) develop
|
|
||||||
@echo ""
|
|
||||||
@echo " ✓ Release v$(VERSION) veröffentlicht 🚀"
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# SYNC — nur Dateien zur DS übertragen, kein Docker-Rebuild
|
# SYNC — nur Dateien zur DS übertragen, kein Docker-Rebuild
|
||||||
# ACHTUNG: ALLE Dateien (CSS/JS/HTML/Python) sind ins Image gebacken!
|
# ACHTUNG: ALLE Dateien (CSS/JS/HTML/Python) sind ins Image gebacken!
|
||||||
|
|
|
||||||
|
|
@ -94,15 +94,6 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<!-- Staging-Banner (nur auf staging.banyaro.app) -->
|
|
||||||
<div id="staging-banner"
|
|
||||||
style="display:none;position:fixed;top:0;left:0;right:0;z-index:10000;
|
|
||||||
background:#7c3aed;color:#fff;font-size:0.75rem;font-weight:700;
|
|
||||||
padding:5px 16px;align-items:center;justify-content:center;gap:8px;
|
|
||||||
letter-spacing:0.04em;text-transform:uppercase">
|
|
||||||
⚗️ Staging-Umgebung — Keine Produktionsdaten
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Offline-Banner -->
|
<!-- Offline-Banner -->
|
||||||
<div id="offline-banner" aria-live="polite"
|
<div id="offline-banner" aria-live="polite"
|
||||||
style="display:none;position:fixed;top:0;left:0;right:0;z-index:9999;
|
style="display:none;position:fixed;top:0;left:0;right:0;z-index:9999;
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,7 @@
|
||||||
Router, State-Management, Navigation, Initialisierung.
|
Router, State-Management, Navigation, Initialisierung.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const APP_VER = '490'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
const APP_VER = '489'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||||
const APP_VERSION = '1.0.0'; // ← semantische Version, wird bei make release gesetzt
|
|
||||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
|
||||||
|
|
||||||
const App = (() => {
|
const App = (() => {
|
||||||
|
|
||||||
|
|
@ -862,11 +860,4 @@ const App = (() => {
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// App starten
|
// App starten
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => App.init());
|
||||||
if (IS_STAGING) {
|
|
||||||
const b = document.getElementById('staging-banner');
|
|
||||||
if (b) b.style.display = 'flex';
|
|
||||||
document.title = '⚗️ ' + document.title;
|
|
||||||
}
|
|
||||||
App.init();
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -334,7 +334,7 @@ window.Page_settings = (() => {
|
||||||
<span style="background:var(--c-surface-2);border:1px solid var(--c-border);
|
<span style="background:var(--c-surface-2);border:1px solid var(--c-border);
|
||||||
border-radius:100px;padding:2px 10px;font-family:monospace;
|
border-radius:100px;padding:2px 10px;font-family:monospace;
|
||||||
font-size:10px;color:var(--c-text-muted)">
|
font-size:10px;color:var(--c-text-muted)">
|
||||||
v${typeof APP_VERSION !== 'undefined' ? APP_VERSION : '1.0.0'} <span style="opacity:0.5;font-size:10px">(${typeof APP_VER !== 'undefined' ? APP_VER : '—'})</span>
|
v${typeof APP_VER !== 'undefined' ? APP_VER : '—'}
|
||||||
</span>
|
</span>
|
||||||
<button id="settings-check-update" style="background:none;border:none;cursor:pointer;
|
<button id="settings-check-update" style="background:none;border:none;cursor:pointer;
|
||||||
font-size:var(--text-xs);color:var(--c-primary);padding:2px 6px;
|
font-size:var(--text-xs);color:var(--c-primary);padding:2px 6px;
|
||||||
|
|
@ -588,7 +588,7 @@ window.Page_settings = (() => {
|
||||||
reg.waiting.postMessage({ type: 'SKIP_WAITING' });
|
reg.waiting.postMessage({ type: 'SKIP_WAITING' });
|
||||||
UI.toast.success('Update wird installiert…');
|
UI.toast.success('Update wird installiert…');
|
||||||
} else {
|
} else {
|
||||||
UI.toast.success('Ban Yaro ist aktuell — v' + (typeof APP_VERSION !== 'undefined' ? APP_VERSION : '1.0.0') + '.');
|
UI.toast.success('Ban Yaro ist aktuell (v' + (typeof APP_VER !== 'undefined' ? APP_VER : '—') + ').');
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
UI.toast.error('Update-Prüfung fehlgeschlagen.');
|
UI.toast.error('Update-Prüfung fehlgeschlagen.');
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"id": "/",
|
"id": "/",
|
||||||
"version": "1.0.0",
|
|
||||||
"name": "Ban Yaro — Die Hunde-Plattform",
|
"name": "Ban Yaro — Die Hunde-Plattform",
|
||||||
"short_name": "Ban Yaro",
|
"short_name": "Ban Yaro",
|
||||||
"description": "Alles rund um deinen Hund. Von Welpe bis Opa.",
|
"description": "Alles rund um deinen Hund. Von Welpe bis Opa.",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Offline-Cache + Push Notifications + Tile-Cache
|
Offline-Cache + Push Notifications + Tile-Cache
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const CACHE_VERSION = 'by-v513';
|
const CACHE_VERSION = 'by-v512';
|
||||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
services:
|
|
||||||
banyaro-staging:
|
|
||||||
build: .
|
|
||||||
container_name: banyaro-staging
|
|
||||||
restart: on-failure:3
|
|
||||||
ports:
|
|
||||||
- "3012:8000"
|
|
||||||
volumes:
|
|
||||||
- ./data:/data
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
environment:
|
|
||||||
- DB_PATH=/data/banyaro.db
|
|
||||||
- MEDIA_DIR=/data/media
|
|
||||||
- STAGING=true
|
|
||||||
- VAPID_PUBLIC_KEY=BMKbFAmpsqJ-eFef_4XJcYpuxPWqBNAoy9buMNnMSa6ijcPzltboHi_YccPKJrUD0isBez-vJIzAgjnLTWkzcC0
|
|
||||||
- VAPID_PRIVATE_KEY=8PWa9vvwMqtqsJEJGcwmiLhR0_Yl7duVX3wmWiKS878
|
|
||||||
- VAPID_CONTACT=mailto:admin@banyaro.app
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/')"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue