Zwei Bitbucket‑Repos (App vs. API) mit klarer Trennung von Frontend und Backend. Versionierte Schnittstellen und saubere Geheimnis‑Verwaltung halten die Zusammenarbeit stabil und nachvollziehbar.
- App (Frontend, Expo/React Native)
- URL: https://bitbucket.org/99grad/app.pedagotchi/src/master/
- Zweck: Mobile App Code (Expo Router, Tamagui, MobX, Context‑Library Integration).
- Standard‑Branch: aktuell „master“.
- API/Backend (Directus/Server)
- URL: https://bitbucket.org/99grad/api.pedagotchi.de/src/main/
- Zweck: Directus‑Konfiguration, Server‑Infra/Deploy‑Artefakte.
- Standard‑Branch: „main“.
Continuous Deployment #
Die Pipeline für
api.pedagotchi.debaut auf einem Ubuntu-Container, richtet zur Laufzeit SSH/Git ein, authentifiziert sich per Pipeline-Secret, und pusht denmain-Branch direkt in Dokku auf Hetzner. Dokku übernimmt Build/Deploy der API.
- Repository:
api.pedagotchi.de(Branchmain) - Ziel: Deployment der Directus/API auf dem Server via Dokku (
dokku@api.pedagotchi.de:pedagotchi) - Pipeline-Datei:
bitbucket-pipelines.yml(Konfiguration ähnlich zum Snippet unten)
Pipeline-Snippet (Referenz) #
image: ubuntu:latest
pipelines:
branches:
main:
- step:
name: "Setup Environment and Test Variables"
deployment: production
script:
- set -e
- apt-get update
- apt-get install -y git ssh
- echo "Starting Deployment"
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- eval $(ssh-agent -s)
- ssh-add ~/.ssh/id_rsa
- ssh-keyscan -H api.pedagotchi.de >> ~/.ssh/known_hosts
- git remote add dokku dokku@api.pedagotchi.de:pedagotchi
- git push dokku main:master