Deployment Strategies
This guide covers different strategies for deploying updates using Source Push.
Overview
A well-planned deployment strategy helps you:
- Minimize risk
- Maintain app stability
- Ensure smooth user experience
- Quickly respond to issues
Standard Deployment Types
1. Staged Rollout
Release updates gradually to a percentage of users:
# Release to 20% of users
srcpush release-react MyApp-iOS ios -r 20
# Increase to 50% after monitoring
srcpush patch MyApp-iOS Production -r 50
# Complete rollout to all users
srcpush patch MyApp-iOS Production -r 100
Benefits:
- Early detection of issues
- Limited impact if problems occur
- Gradual server load increase
- Time to monitor metrics
2. Environment-Based Deployment
Use different deployments for different environments:
# Create environments
srcpush deployment add MyApp-iOS Development
srcpush deployment add MyApp-iOS QA
srcpush deployment add MyApp-iOS UAT
# Release to development
srcpush release-react MyApp-iOS ios -d Development
# Promote to QA after testing
srcpush promote MyApp-iOS Development QA
# Promote to production
srcpush promote MyApp-iOS QA Production
Benefits:
- Controlled testing process
- Clear promotion path
- Environment isolation
- Easy rollback capability
3. A/B Testing
Test different versions with different user groups:
# Create test deployments
srcpush deployment add MyApp-iOS TestA
srcpush deployment add MyApp-iOS TestB
# Release different versions
srcpush release-react MyApp-iOS ios -d TestA
srcpush release-react MyApp-iOS ios -d TestB
Benefits:
- Feature validation
- User behavior analysis
- Performance comparison
- Data-driven decisions
Advanced Strategies
1. Mandatory Updates
Force critical updates:
# Release mandatory update
srcpush release-react MyApp-iOS ios -m
# Make existing update mandatory
srcpush patch MyApp-iOS Production -m
Use Cases:
- Critical bug fixes
- Security patches
- Breaking API changes
- Legal compliance updates
2. Silent Updates
Deploy updates without user notification:
srcpush release-react MyApp-iOS ios --silent
Use Cases:
- Minor bug fixes
- Performance improvements
- Asset updates
- A/B test variations
3. Version-Targeted Updates
Target specific app versions:
# Target single version
srcpush release-react MyApp-iOS ios -t "1.2.3"
# Target version range
srcpush release-react MyApp-iOS ios -t ">=1.2.0 <1.3.0"
Benefits:
- Version-specific fixes
- Controlled upgrade path
- Legacy version support
- Migration management
Best Practices
1. Release Planning
- Document release process
- Define success criteria
- Plan rollback strategy
- Prepare communication plan
2. Monitoring
Monitor key metrics:
- Installation success rate
- Crash reports
- User feedback
- Performance metrics
3. Testing
Test updates thoroughly:
- Different devices
- Various OS versions
- Network conditions
- Update scenarios
4. Communication
Keep stakeholders informed:
- Release notes
- Known issues
- Rollout progress
- Incident reports
Rollback Strategy
Quick Rollback
# Immediate rollback
srcpush rollback MyApp-iOS Production
# Rollback to specific version
srcpush rollback MyApp-iOS Production --targetRelease v7
Gradual Rollback
# Disable current release
srcpush patch MyApp-iOS Production --disabled
# Release previous version gradually
srcpush release-react MyApp-iOS ios -r 20
CI/CD Integration
GitHub Actions Example
jobs:
deploy:
steps:
- name: Release to Staging
run: srcpush release-react MyApp-iOS ios -d Staging
- name: Wait for validation
run: sleep 3600
- name: Promote to Production
if: success()
run: srcpush promote MyApp-iOS Staging Production -r 20
Automated Rollout
#!/bin/bash
# Progressive rollout script
percentages=(20 40 60 80 100)
for p in "${percentages[@]}"; do
srcpush patch MyApp-iOS Production -r $p
sleep 3600 # Wait an hour between increases
done
Metrics and Monitoring
Key Metrics to Track
-
Update Success Rate:
srcpush deployment history MyApp-iOS Production
-
Active Users per Version:
srcpush deployment ls MyApp-iOS -k
-
Rollback Frequency: Monitor automatic rollbacks in deployment history