# tbi-rlv-redtag-app - Dev Environment

## Pipeline Overview

CircleCI pipeline for `tbi-rlv-redtag-app` — a React Native mobile app deploying to TestFlight (iOS) and Firebase App Distribution (Android).

## Triggered Branches
- `develop` (QA builds)
- `master` / `main` (Production builds)

## Pipeline Stages
1. **lint-and-test** - Install deps, lint, test, type check
2. **build-ios** - Build iOS archive via xcodebuild, export IPA, upload to TestFlight
3. **build-android** - Build Android APK via Gradle, upload to Firebase App Distribution

## Build Variants
| Branch | iOS Scheme | iOS Config | Android Variant |
|--------|-----------|------------|-----------------|
| develop | RedTag QA | Release-QA | assembleQaRelease |
| master/main | RedTag | Release | assembleProdRelease |

## Required CircleCI Context Variables (`devops-mgt`)

### iOS (TestFlight)
- `IOS_DISTRIBUTION_CERTIFICATE_BASE64` - Base64-encoded .p12 distribution certificate
- `IOS_CERTIFICATE_PASSWORD` - Password for the .p12 certificate
- `IOS_PROVISIONING_PROFILE_BASE64` - Base64-encoded provisioning profile
- `KEYCHAIN_PASSWORD` - Temporary keychain password (any value)
- `APP_STORE_CONNECT_API_KEY_ID` - App Store Connect API key ID
- `APP_STORE_CONNECT_ISSUER_ID` - App Store Connect issuer ID

### Android (Firebase)
- `ANDROID_KEYSTORE_BASE64` - Base64-encoded release keystore
- `FIREBASE_APP_ID` - Firebase App ID for distribution
- `FIREBASE_TOKEN` - Firebase CI token (`firebase login:ci`)

## Updating Secrets
Secrets are managed manually via CircleCI context `devops-mgt`. To update:
1. Go to CircleCI → Organization Settings → Contexts → `devops-mgt`
2. Update the relevant environment variable
3. Re-run the pipeline
