Multi-Environment Setup
Multi-Environment Setup
Section titled “Multi-Environment Setup”Set up separate pipelines for different environments.
Pipeline Approach
Section titled “Pipeline Approach”Create separate pipelines for each environment:
- Development - On push to
develop - Staging - On push to
main - Production - Manual trigger with approval
Using Flutter Flavors
Section titled “Using Flutter Flavors”Configure flavors in your Flutter app:
flutter: flavors: development: app-name: "My App Dev" staging: app-name: "My App Staging" production: app-name: "My App"Build with flavor:
flutter build apk --flavor productionEnvironment Variables
Section titled “Environment Variables”Use different variables per pipeline:
API_URL- Different per environmentANALYTICS_KEY- Different per environment
Local Development Setup
Section titled “Local Development Setup”For local API development, you can run agents that connect to both local and production APIs with automatic failover.
CLI Profile Setup
Section titled “CLI Profile Setup”Use profiles to maintain separate CLI configurations:
# Login to productionflightstack login
# Login to local development APIflightstack login --profile dev --api-url http://localhost:5000This creates:
~/.flightstack/cli_config.json- Production credentials~/.flightstack/cli_config.dev.json- Local development credentials
Agent Profile Setup
Section titled “Agent Profile Setup”Register separate agents for each environment:
# Register agent for productionflightstack-agent register
# Register agent for local developmentflightstack-agent register --profile dev --api-url http://localhost:5000Multi-URL Agent (Recommended)
Section titled “Multi-URL Agent (Recommended)”For seamless development, run the agent with multiple API URLs. The agent automatically:
- Connects to the first available API (local takes priority)
- Falls back to production if local is unavailable
- Reconnects to local when it becomes available again
flightstack-agent start \ --api-url http://localhost:5000 \ --api-url https://api.flightstack.voostack.com \ --reconnect-interval 30Environment Variable Profiles
Section titled “Environment Variable Profiles”Set a default profile using environment variables:
# Add to your ~/.zshrc or ~/.bashrcexport FLIGHTSTACK_PROFILE=dev
# Now all commands use the dev profile by defaultflightstack status # Uses dev profileflightstack-agent start # Uses dev profileSharing Authentication
Section titled “Sharing Authentication”The agent automatically loads authentication from your CLI config. If you’re logged in via flightstack login, the agent registration will use the same credentials.