Skip to main content

Advanced Deployment Strategies with Source Push

· 2 min read
Hebert
FullStack Software Developer | Node.js, Laravel, React.js, React Native

Deploying updates to your React Native app requires careful planning and execution. In this guide, we'll explore different deployment strategies available with Source Push and when to use them.

Understanding Deployment Environments

Source Push supports multiple deployment environments out of the box:

# Create staging and production deployments
srcpush deployment add MyApp Staging
srcpush deployment add MyApp Production

This allows you to test updates before rolling them out to all users.

Staged Rollouts

Staged rollouts help minimize the impact of potential issues by gradually releasing updates to users:

# Release to 25% of users initially
srcpush release-react MyApp ios --rollout 25

# Once confident, increase to 100%
srcpush deployment history MyApp Production
srcpush rollout MyApp Production v5 100

A/B Testing

Test different versions of your app with specific user segments:

# Release version A
srcpush release-react MyApp ios -d Production-A

# Release version B
srcpush release-react MyApp ios -d Production-B

Automatic Rollbacks

Source Push includes automatic rollback protection:

srcpush release-react MyApp ios --rollback-enabled true

This will automatically roll back if an update causes crashes above your defined threshold.

Best Practices

  1. Always Test in Staging

    srcpush release-react MyApp ios -d Staging
    # Verify in staging before promoting
    srcpush promote MyApp Staging Production
  2. Monitor Update Metrics

    • Track download success rates
    • Monitor crash reports
    • Watch adoption rates
  3. Version Targeting

    srcpush release-react MyApp ios --target-binary-version "~1.2.3"
  4. Emergency Updates

    srcpush release-react MyApp ios --mandatory true

CI/CD Integration

Automate your deployments with our CI/CD integrations:

# GitHub Actions example
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Source Push CLI
run: npm install -g @srcpush/code-push-cli
- name: Release Update
run: srcpush release-react MyApp ios -d Staging
env:
SRCPUSH_TOKEN: ${{ secrets.SRCPUSH_TOKEN }}

Monitoring Deployments

Keep track of your deployments using our monitoring tools:

# Check deployment history
srcpush deployment history MyApp Production

# View specific deployment details
srcpush deployment info MyApp Production

Conclusion

Effective deployment strategies are crucial for maintaining app stability and user satisfaction. Source Push provides all the tools you need to implement sophisticated deployment workflows that match your team's needs.

For more detailed information, check out our deployment documentation and CI/CD integration guides.