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

The White Glove Treatment: Polishing Your iOS Build with Jenkins

The White Glove Treatment: Polishing Your iOS Build with Jenkins

We use continuous integration and delivery systems to help us build apps all the time. Our pull requests trigger builds that we can test, merging them triggers other builds that we can deploy, and so on. What about all of the other tedious tasks involved in development? This talk will cover using Jenkins, fastlane, and other tools as a system to automatically update an iOS app's dependencies—whether you use CocoaPods, Carthage, or the Swift Package Manager—provide inline feedback on pull requests, and manage tedious distribution work. By the end, you'll have tools at your disposal to let Jenkins do the tedious part of app development, letting you take care of what's actually important.

Jeff Kelley

August 22, 2019
Tweet

More Decks by Jeff Kelley

Other Decks in Technology

Transcript

  1. The White Glove Treatment Polishing Your iOS Build with Jenkins

    Jeff Kelley (@SlaunchaMan) Abstractions II, August 22nd, 2019
  2. Agenda Automate Repetitive Tasks Manage Long-Running Tasks Serve as the

    Authoritative Build Server Control Access to Administrative Actions Jenkins image by the Jenkins Project. CC BY-SA 3.0
  3. Agenda Automate Repetitive Tasks Manage Long-Running Tasks Serve as the

    Authoritative Build Server Control Access to Administrative Actions Jenkins image by the Jenkins Project. CC BY-SA 3.0
  4. Automate Repetitive Tasks PR Builds • Probably the most-run Jenkins

    job • Build the code, run the test suite, deploy build for QA • Can have multiple checks that all must pass to merge Jeff Kelley |
  5. Automate Repetitive Tasks PR Builds • Probably the most-run Jenkins

    job • Build the code, run the test suite, deploy build for QA • Can have multiple checks that all must pass to merge Jeff Kelley |
  6. Automate Repetitive Tasks Pushing New Versions • Triggered on a

    push to master for projects that build libraries • Automatically push to CocoaPods, tag Git release, tweet about it, etc. Jeff Kelley |
  7. Automate Repetitive Tasks Dependency Updates • Stay on top of

    important security updates • Usually only a handful of updates when run daily • Prevents large sets of updates when projects get around to it Jeff Kelley |
  8. Agenda Automate Repetitive Tasks Manage Long-Running Tasks Serve as the

    Authoritative Build Server Control Access to Administrative Actions Jenkins image by the Jenkins Project. CC BY-SA 3.0
  9. Manage Long-Running Tasks UI Testing UI tests are: • Great

    for regression testing • Easy to write with Xcode • Extremely fragile • Slow Jeff Kelley |
  10. Manage Long-Running Tasks Mutation Testing1 • Changes your code and

    sees if your tests fail • Runs your test suite after each change • Can take many hours 1 For mutation testing in Swift, use Sean Olszewski’s Muter. Jeff Kelley |
  11. Agenda Automate Repetitive Tasks Manage Long-Running Tasks Serve as the

    Authoritative Build Server Control Access to Administrative Actions Jenkins image by the Jenkins Project. CC BY-SA 3.0
  12. Serve as the Authoritative Build Server When it’s time to

    ship, your project has some output • iOS: .ipa file or direct App Store submission • Android: .apk file or direct Google Play submission • Web: Docker images How do you know what’s in those builds? Jeff Kelley |
  13. Serve as the Authoritative Build Server fastlane Google’s fastlane tool

    simplifies iOS workflows • Build your app and run your tests • Submit to Crashlytics, TestFlight, or the App Store • Generate screenshots across every combination of device size/language Jeff Kelley |
  14. Serve as the Authoritative Build Server Recently Apple made a

    change that the required the main Apple ID on your Apple Developer to use two-factor authentication.2 Many people complained about Jenkins breaking due to this. You should not ever store the password to this account on Jenkins or any other CI system. Someone with access to your Jenkins instance could simply add this to a build script: echo ${JENKINS_APPLE_ID_USERNAME} echo ${JENKINS_APPLE_ID_PASSWORD} 2 Apple uses their own proprietary 2FA solution, so many common products couldn’t solve this problem. Jeff Kelley |
  15. Agenda Automate Repetitive Tasks Manage Long-Running Tasks Serve as the

    Authoritative Build Server Control Access to Administrative Actions Jenkins image by the Jenkins Project. CC BY-SA 3.0
  16. Thank You! Fastlane Template: https://github.com/detroit-labs/fastlane-template Contact info: Jeff Kelley Slides:

    https://speakerdeck.com/SlaunchaMan Twitter: @SlaunchaMan E-Mail: jeff@detroitlabs.com