Impulse AI Docs
Intern dokumentasjon
skipLink.label

Release-rutiner

Denne siden beskriver hele release-flyten for Impulse AI: fra feature branch til produksjon.

DB + API (tett koblet)

heading.anchorLabel
Feature branch → PR → CI Gate → main → Staging (auto) → /deploy-prod → Production
KomponentStaging-deployProduksjons-deploy
APIRailway auto-deploy fra mainRailway auto-deploy fra production branch
Databasesupabase db push via CI (auto)supabase db push ved push til production

iOS (separat release-syklus)

heading.anchorLabel
fastlane ios bump → git tag v* → TestFlight (auto) → App Store (manuell promote)
KomponentStaging-deployProduksjons-deploy
iOSTestFlight via fastlane ios betaApp Store via fastlane ios promote

Web (uavhengig)

heading.anchorLabel
KomponentStaging-deployProduksjons-deploy
WebVercel preview deploy (auto)Vercel auto-deploy fra main

Railway-miljoer

heading.anchorLabel
MiljoBranchURL
Stagingmainapi-stg.impulseai.app
Productionproductionapi.impulseai.app

CI kjoerer automatisk paa alle PR-er og push til main/develop. Kun endrede deler bygges.

Endring iJobbKjoretid
packages/database/db-check (migrasjoner + typer)~2 min
apps/api/ eller packages/shared/api-check (lint + types + test + build)~1 min
apps/mobile-kmp/shared/ eller iosApp/ios-preflight (KMP + Xcode build)~5 min
apps/mobile-kmp/shared/ eller androidApp/android-preflight (KMP + Gradle)~3 min
Ingen matchBare ci-gate (instant)~5 sek

ci-gate er satt som required status check i GitHub branch protection. Ingenting merges til main uten at CI passerer.

Release-syklus

heading.anchorLabel

Anbefalt ritme

heading.anchorLabel
Mandag-Torsdag: Utvikling
Push → CI preflight (automatisk)
PR → ci-gate maa passere foer merge
Fredag: Release DB + API
1. Merge feature-branch → main
2. CI passerer → Railway auto-deployer API til staging
3. Database: staging-migrasjoner kjoeres automatisk
4. Test staging
5. /deploy-prod → promoter til production
Fredag: iOS-release (separat)
6. fastlane ios bump type:patch → git tag → TestFlight
7. Test i TestFlight over helgen
Mandag: Promoter iOS
8. /promote → App Store

iOS-versjonen bumpes med Fastlane:

Terminal window
cd apps/mobile-kmp/iosApp
# Bump versjon
bundle exec fastlane ios bump type:patch # 1.0.0 → 1.0.1
bundle exec fastlane ios bump type:minor # 1.0.0 → 1.1.0
bundle exec fastlane ios bump type:major # 1.0.0 → 2.0.0
# Push versjon + tag
git push && git push --tags

bump laner committer versjonsendringen og oppretter en git tag (v1.0.1).

TestFlight (beta)

heading.anchorLabel
Terminal window
# Lokalt:
cd apps/mobile-kmp/iosApp
bundle exec fastlane ios beta
# Eller via GitHub Actions:
# Actions → "iOS Release" → Run workflow → "beta"

Hva beta gjoer:

  1. Synker signing-sertifikater (Match)
  2. Auto-inkrementerer build number fra TestFlight
  3. Bygger KMP release framework
  4. Arkiverer iOS-appen
  5. Laster opp til TestFlight
  6. Committer versjon-bump og tagger

App Store (promote)

heading.anchorLabel
Terminal window
# Promoter siste TestFlight-bygg til App Store Connect:
bundle exec fastlane ios promote
# Eller via GitHub Actions:
# Actions → "iOS Release" → Run workflow → "promote"
Terminal window
# Bygger nytt + sender til App Store Connect:
bundle exec fastlane ios release

Dette kjoerer beta + promote i sekvens.

Produksjons-deploy (DB + API)

heading.anchorLabel

DB og API promoteres til production ved a pushe main til production-branchen:

Terminal window
# Via Claude Code (anbefalt):
/deploy-prod
# Manuelt:
git push origin main:production

Dette trigger:

  • DB: supabase db push mot produksjons-Supabase
  • API: Railway auto-deployer fra production-branchen

Railway staging overvaker main branch og auto-deployer. Ingen manuell handling noedvendig.

URL: api-stg.impulseai.app

Sikkerhet: Branch protection sikrer at ci-gate passerer foer merge til main — Railway deployer aldri broken kode.

Railway production overvaker production branch og auto-deployer.

URL: api.impulseai.app

Terminal window
# Promoter staging til production:
/deploy-prod
# eller: git push origin main:production

Database-migrasjoner

heading.anchorLabel

Staging (automatisk)

heading.anchorLabel

Naar DB-endringer merges til main, kjoerer CI automatisk supabase db push mot staging-prosjektet.

To alternativer:

Automatisk via git tag:

Terminal window
git tag v1.2.3 && git push --tags
# deploy-production.yml kjoerer supabase db push mot prod

Manuelt via GitHub Actions:

Terminal window
# Actions → "DB Deploy (manual)" → Run workflow
# 1. Velg environment: staging eller production
# 2. Velg action: dry-run (foerst!) eller migrate

Migrasjon-workflow

heading.anchorLabel
1. Opprett migrering lokalt:
pnpm db:migrate:new din_migrering
2. Skriv SQL i packages/database/supabase/migrations/
3. Test lokalt:
pnpm db:reset
4. Generer TypeScript-typer:
pnpm db:types
5. Commit og push → CI validerer
6. Merge til main → staging auto-deploy
7. Verifiser i staging → /deploy-prod → prod deploy

Web Deploy (Vercel)

heading.anchorLabel

Vercel deployer automatisk:

  • Preview: Hver PR faar sin egen preview-URL
  • Production: Auto-deploy fra main for landing (impulseai.app) og console (console.impulseai.app)

Ingen manuell handling noedvendig.

Se Rollback-prosedyrer for detaljerte instruksjoner.

Hurtigreferanse:

KomponentRollback-metodeTid
APIRailway: redeploy forrige versjon~30 sek
DatabaseNy migrering som reverser endringenMinutter
iOSIkke mulig — push ny versjonTimer/dager
WebVercel: instant rollback i dashboard~5 sek

Fastlane-oversikt

heading.anchorLabel

Alle iOS-operasjoner gaar gjennom Fastlane. GitHub Actions er bare en tynn wrapper.

LaneJobbTrigger
preflightKMP compile + iOS simulator buildAutomatisk (CI)
testKjoer iOS-testerManuelt
betaBuild → TestFlightManuelt / git tag
promoteSiste TestFlight → App Store metadataManuelt
releaseFull: beta + App Store submitManuelt
bumpVersjonering (patch/minor/major)Manuelt
doctorSjekk toolchainManuelt

Lokal Fastlane-bruk

heading.anchorLabel
Terminal window
cd apps/mobile-kmp/iosApp
# Installer Ruby-deps (foerste gang):
bundle install
# Sjekk at alt fungerer:
bundle exec fastlane ios doctor
# Sjekk kompilering:
bundle exec fastlane ios preflight

GitHub Actions Workflows

heading.anchorLabel
WorkflowFilTrigger
CIci.ymlPush/PR til main
Deploy Productiondeploy-production.ymlPush til production branch
iOS Release (manual)ios-release.ymlGit tag v* / manuell (promote/beta/release)
DB Deploy (manual)db-deploy.ymlManuell (dry-run/migrate)

”No signing certificate found"

heading.anchorLabel
Terminal window
bundle exec fastlane match appstore --force # Regenerer sertifikater

"Build number already exists on TestFlight”

heading.anchorLabel

Build-nummeret auto-inkrementeres. Hvis det feiler, har du sannsynligvis et lokalt bygg med hoeyere nummer. Sjekk i App Store Connect.

Preflight feiler i CI

heading.anchorLabel
Terminal window
# Sjekk at Gradle wrapper er committert:
git ls-files apps/mobile-kmp/gradlew
# Skal vise filen. Hvis ikke: git add apps/mobile-kmp/gradlew

KMP-endringer kompilerer lokalt men ikke i CI

heading.anchorLabel

CI bruker cached Gradle. Push en tom commit eller vent til cache utloeper.


Nokkelrotasjon

heading.anchorLabel

Nar API-klientnokkelen (X-API-Key) ma byttes ut — ved mistanke om misbruk, teamendringer, eller rutinemessig.

StegHandlingVerktoy
1Generer ny nokkelopenssl rand -hex 32
2Legg til ny nokkelDoppler: API_CLIENT_KEY = gammel,ny
3Deploy APIRailway resyncer automatisk
4Oppdater Environment.ktBytt apiClientKey for riktig miljo
5Ship app-oppdateringfastlane ios beta
6Sett minimum versjonDoppler: MIN_APP_VERSION_IOS = X.Y.Z
7MonitorerSjekk keyPrefix i Railway logs
8Fjern gammel nokkelDoppler: API_CLIENT_KEY = ny
  • Ved hendelse (lekkasje, misbruk): Umiddelbart
  • Rutinemessig: Arlig er tilstrekkelig — noklene er ikke hemmelige (synlige i app-binary)

Nar du ma tvinge brukere til a oppdatere appen — f.eks. ved nokkelrotasjon, breaking API-endringer, eller kritiske feilrettinger.

Sett minimum versjon i Doppler:

Terminal window
# Alle brukere pa iOS under v1.2.0 ser fullskjerm "Oppdater nå"
MIN_APP_VERSION_IOS=1.2.0
# Valgfritt: soft nudge for brukere under nyeste
LATEST_APP_VERSION_IOS=1.3.0

Railway resyncer automatisk — ingen deploy nodvendig.

Sett tilbake til 0.0.0 eller fjern variabelen.

Brukeropplevelse

heading.anchorLabel
SituasjonResultat
App-versjon < MIN_APP_VERSIONFullskjerm-blokk, kun “Oppdater nå”-knapp
App-versjon < LATEST_APP_VERSIONDismissbar dialog med “Oppdater” / “Senere”
Config-kall feiler (nettverk)Normal oppstart — aldri blokker pa feil