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.

8d92e9730c561c120200f34e7e50ed46?s=128

Jeff Kelley

August 22, 2019
Tweet

Transcript

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

    Jeff Kelley (@SlaunchaMan) Abstractions II, August 22nd, 2019
  2. The White Glove Treatment Polishing Your iOS Build with Jenkins

    Jeff Kelley |
  3. The White Glove Treatment Polishing Your iOS Build with Jenkins

    Continuous Integration Jeff Kelley |
  4. The App Development Process 1. Ideation/Design 2. Build 3. Test

    4. Deploy Jeff Kelley |
  5. 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
  6. 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
  7. 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 |
  8. 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 |
  9. 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 |
  10. Automate Repetitive Tasks Dependency Updates Jeff Kelley |

  11. 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 |
  12. 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
  13. Manage Long-Running Tasks UI Testing UI tests are: • Great

    for regression testing • Easy to write with Xcode • Extremely fragile • Slow Jeff Kelley |
  14. 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 |
  15. Manage Long-Running Tasks Handling Multiple Simulated Devices Jeff Kelley |

  16. 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
  17. 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 |
  18. 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 |
  19. 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 |
  20. 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
  21. Control Access to Administrative Actions Taken from apple/swift#26705

  22. 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