Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to Continuous Integration at SoundCloud

Intro to Continuous Integration at SoundCloud

In the past year at SoundCloud, we've improved our CI from a single machine running our limited unit test suite to several machines running a linter, unit tests, acceptance tests and building several versions of our app including the AppStore version for every commit. This enabled us to move away from pull-requests and code reviews and use trunk based development and pairing, as well as scale the team from 3 to 7 developers.
We've stopped relying on Xcode Schemes for builds, we're using instead command line tools and compile-time parameters to automatically build internal versions of our app and distribute it internally.
In order to make our release process more reliable, the AppStore version of the app is created by re-signing an AdHoc build. This enables us to test the exact same binary that will be submitted to the AppStore.
This talk will focus on 3 areas of our continuous integration: testing, building with user defined build settings and signing apps.

Vincent Garrigues

September 04, 2014
Tweet

More Decks by Vincent Garrigues

Other Decks in Programming

Transcript

  1. “Continuous integration (CI) is the practice, in software engineering, of

    merging all developer working copies with a shared mainline several times a day.” http://en.wikipedia.org/wiki/Continuous_integration
  2. iOS Crash Complaints (avg per Week) 0 35 70 105

    140 April May June July August SoundCloud community team
  3. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release

    display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  4. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release

    display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  5. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release

    display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  6. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release

    display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  7. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release

    display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  8. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release

    display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  9. defaults: (..) ! alpha: <<: *DEFAULTS app: <<: *APP_DEFAULTS display_name:

    α bundle_identifier: com.company.ci-test-alpha codesign: <<: *CODESIGN_DEFAULTS provisioning_profile: provisioning/alpha.mobileprovision
  10. defaults: (..) ! alpha: <<: *DEFAULTS app: <<: *APP_DEFAULTS display_name:

    α bundle_identifier: com.company.ci-test-alpha codesign: <<: *CODESIGN_DEFAULTS provisioning_profile: provisioning/alpha.mobileprovision
  11. defaults: (..) ! alpha: <<: *DEFAULTS app: <<: *APP_DEFAULTS display_name:

    α bundle_identifier: com.company.ci-test-alpha codesign: <<: *CODESIGN_DEFAULTS provisioning_profile: provisioning/alpha.mobileprovision
  12. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone

    Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  13. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone

    Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  14. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone

    Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  15. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone

    Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  16. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone

    Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  17. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone

    Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  18. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone

    Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  19. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone

    Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  20. • rake build sign BUILD_ENV=alpha • rake build sign BUILD_ENV=beta

    • rake build sign BUILD_ENV=adhoc • rake build sign BUILD_ENV=appstore
  21. rake build BUILD_ENV=appstore rake ipa BUILD_ENV=appstore rake ipa BUILD_ENV=adhoc ci-test-appstore.app

    ci-test-appstore.dSYM ci-test-appstore.dSYM.zip ci-test-appstore.ipa ci-test-adhoc.ipa
  22. rake build BUILD_ENV=appstore rake ipa BUILD_ENV=appstore rake ipa BUILD_ENV=adhoc ci-test-appstore.app

    ci-test-appstore.dSYM ci-test-appstore.dSYM.zip ci-test-appstore.ipa ci-test-adhoc.ipa
  23. • linter (Xcode project, data model, acceptance tests, ruby, ObjC)

    • static analysis • unit tests (ruby and ObjC) • acceptance tests • custom app icon • deploy to HockeyApp • …