Impulse AI Docs
Intern dokumentasjon
Hopp til innhold

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 iJobbWorkflowKjoretid
packages/database/db-check (migrasjoner + typer)ci-backend.yml~2 min
apps/api/ eller packages/shared/api-check (lint + types + test + build)ci-backend.yml~1 min
apps/mobile-kmp/shared/ eller iosApp/ios-preflight (KMP + Xcode build)ci-ios.yml~5 min
apps/mobile-kmp/shared/ eller androidApp/android-preflight (KMP + Gradle)ci-ios.yml~3 min
Ingen matchBare ci-gate/ios-gate (instant)begge~5 sek

CI Gate (ci-backend.yml) og iOS Gate (ci-ios.yml) er satt som required status checks i GitHub branch protection. Ingenting merges til main uten at begge 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).

3 ruter til TestFlight

heading.anchorLabel
RuteNaarKommando
1. ios-release.yml (primaer)Normal release med ny versjonfastlane ios bumpgit push --tagsios-release.yml workflow_dispatch
2. Tag-trigger (automatisk)Backup — trigger via deploy-production.ymlfastlane ios bumpgit push --tags
3. Lokal build (noedloesning)CI er nede, haster med hotfixdoppler run lokalt

Rute 1: ios-release.yml workflow_dispatch (anbefalt)

heading.anchorLabel
Terminal window
cd apps/mobile-kmp/iosApp
# 1. Bump versjon (committer + tagger automatisk)
bundle exec fastlane ios bump type:patch # 1.0.0 → 1.0.1
# 2. Push commit og tag
git push && git push --tags
# 3. Trigger build via GitHub Actions
# Actions → "iOS Release" → Run workflow → lane: beta

Hva som skjer i CI (ios-release.yml eller deploy-production.yml):

  1. Job kjoerer paa macos-26 (Xcode 26, iOS 26 SDK)
  2. Ruby gems installeres til $RUNNER_TEMP/bundle (unngaar at Xcode scanner vendor/)
  3. Doppler henter secrets (DOPPLER_TOKEN_PRD)
  4. fastlane ios beta kjoerer:
    • Signing: setup_ci → installerer WWDR G3-sertifikat → match appstoreupdate_code_signing_settings (Manual for app target)
    • Build number: Auto-inkrementerer fra TestFlight — ingen commit tilbake til main
    • KMP framework: kmp_release_framework bygger arm64 release og kopierer til baade xcode-frameworks/ og PBXGroup-path (iosSimulatorArm64/debugFramework)
    • Archive: Bygger med manual signing override + SUPPORTED_PLATFORMS=iphoneos (stripper iphonesimulator)
    • Upload: Laster opp til TestFlight

Rute 2: Tag-trigger (automatisk fallback)

heading.anchorLabel

Tag v* trigger ogsaa deploy-production.yml sin deploy-ios job. Men denne kan misse hvis andre commits pushes samtidig til en non-production branch.

Som backup kan du ogsaa bruke deploy-production.yml workflow_dispatch med target: ios.

Rute 3: Lokal build

heading.anchorLabel
Terminal window
cd apps/mobile-kmp/iosApp
doppler run --config prd -- bundle exec fastlane ios beta

Krever lokalt: Xcode 26, Match-sertifikater, Doppler CLI med tilgang til prd.

App Store (promote)

heading.anchorLabel

Etter TestFlight-testing, promoter til App Store:

Terminal window
# Via GitHub Actions (anbefalt):
# Actions → "iOS Release" (ios-release.yml) → Run workflow → lane: promote
# Eller lokalt:
cd apps/mobile-kmp/iosApp
doppler run --config prd -- bundle exec fastlane ios promote

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
betasync_signing → auto build number → KMP release framework → archive (manual signing + iphoneos) → TestFlightworkflow_dispatch / git tag
promoteSiste TestFlight → App Store metadataworkflow_dispatch
releaseFull: beta + App Store submitworkflow_dispatch
bumpVersjonering (patch/minor/major) + git tagManuelt (lokalt)
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
WorkflowFilTriggerHva
CI Backendci-backend.ymlPush/PR til mainDB-check, api-check, CI Gate
CI iOSci-ios.ymlPush/PR til mainiOS preflight, iOS Gate
iOS Releaseios-release.ymlworkflow_dispatch (lane: beta/promote/release)Primaer iOS pipeline — macos-26 runner
Deploy Productiondeploy-production.ymlPush til production ELLER workflow_dispatchDB+API deploy kun — iOS er separat
DB Deploydb-deploy.ymlManuelldry-run eller migrate mot staging/prod

Claude Code Slash Commands

heading.anchorLabel
KommandoHva den gjoer
/release ios patchSafety checks → fastlane ios bump → push → trigger ios-release.yml beta
/release apiSafety checks → git push origin main:production → monitor deploy
/promoteTrigger ios-release.yml promote → App Store Connect
/deploy-prodPush main → production branch (DB + API)
/deploy-statusDashboard: CI, iOS release, production deploy status

”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