Making an Efficient Deploy Bot

Making an Efficient Deploy Bot

These are the slides for my presentation at "Build Eureka.swift × Bitrise"
Event page: https://eure.connpass.com/event/121871/

Note: This topic is an update to my previous presentations at other meetups. We are continuously improving our deployment builds and trying out different tools and services.

06aad43b39f220d9e92cef95745e706d?s=128

John Estropia

March 28, 2019
Tweet

Transcript

  1. MAKING AN EFFICIENT DEPLOYMENT BOT build eureka.swi. × Bitrise 2019/3/28

    @JohnEstropia
  2. @JOHNESTROPIA ➤ Senior Engineer @ ➤ ➤ ! ➤ Dev

    since 2008 (mostly mobile apps) ➤ iAppli, BREW, Windows CE/Mobile ➤ iOS 4.0~ (Swift beta~) ➤ http://github.com/JohnEstropia/CoreStore
  3. AGENDA ➤ Why we needed a deploy bot in Pairs

    JP ➤ Meet our deploy bot ➤ Future features
  4. WHY WE NEEDED A DEPLOY BOT

  5. PAIRS JP IOS TEAM

  6. SERVER ENVIRONMENT (XCODE SCHEMES) Staging (Development) Production

  7. DEPLOYMENT TARGETS AppStore Crashlytics TestFlight

  8. PROBLEM 1: COMPLEX BUILD PATTERNS Staging Production ? ? ?

    ? ? ?
  9. PROBLEM 1: COMPLEX BUILD PATTERNS ➤ Solution: ➤ Fastlane

  10. PROBLEM 2: WAITING FOR BUILD SCRIPTS Staging Production

  11. PROBLEM 2: WAITING FOR BUILD SCRIPTS ➤ Pairs JP project:

    • *.swift: 130,000~ lines of code • *.m: 8,000~ lines of code • Dependencies: • Pods: 50~ frameworks • Carthage: 20~ frameworks ➤ Build Time: • Debug: 5~ minutes (+ preparation + upload time) • Release: 15~ minutes (+ preparation + upload time)
  12. PROBLEM 2: WAITING FOR BUILD SCRIPTS Staging Production ɾɾɾ

  13. PROBLEM 2: WAITING FOR BUILD SCRIPTS ➤ Solution: ➤ Continuous

    Integration / Delivery ➤ We currently use ➤ Work on something else while CI/CD runs
  14. ALL PROBLEM SOLVED?

  15. OUR WEEKLY DEPLOYMENT SCHEDULE Mon Tue Wed Thur Fri Sat

    Sun Code Freeze
  16. OUR WEEKLY DEPLOYMENT SCHEDULE Mon Tue Wed Thur Fri Sat

    Sun Code Freeze QA Test
  17. OUR WEEKLY DEPLOYMENT SCHEDULE Mon Tue Wed Thur Fri Sat

    Sun Code Freeze QA Test AppStore Submission
  18. OUR WEEKLY DEPLOYMENT SCHEDULE Mon Tue Wed Thur Fri Sat

    Sun Code Freeze QA Test AppStore Submission
  19. OUR WEEKLY DEPLOYMENT SCHEDULE Mon Tue Wed Thur Fri Sat

    Sun AppStore Release Code Freeze QA Test AppStore Submission
  20. OUR WEEKLY DEPLOYMENT SCHEDULE Mon Tue Wed Thur Fri Sat

    Sun AppStore Release Code Freeze QA Test AppStore Submission
  21. OUR WEEKLY DEPLOYMENT SCHEDULE ➤ Wednesdays: Code-freeze ➤ Finish new

    features for next version ➤ Deploy testing binary (for QA) ➤ Fridays: AppStore Submission ➤ Finish hotfixes for those features ➤ Deploy production binary (for AppStore review) ➤ Delays = overtime / reschedule update ➤ Monday ~ Friday: Anyone can deploy their own testing binary
  22. PAIRS JP IOS TEAM: PARALLEL DEVELOPMENT

  23. PROBLEM 3: PRIORITY BUILDS Staging Production

  24. MEET OUR SLACKBOT @porygon

  25. @PORYGON: SLACKBOT ➤ Written in Swift! ➤ Runs on a

    dedicated local iMac ➤ Own file system ➤ Own keys/accounts ➤ Own integrations
  26. PAIRS JP DEPLOYMENT FLOWS

  27. PAIRS JP DEPLOYMENT FLOWS

  28. @PORYGON SKILLS

  29. DEPLOY: VIA CHAT COMMAND

  30. DEPLOY: ANIMATED PROGRESS

  31. DEPLOY: HTML LOGS

  32. DEPLOY: CUSTOM REPORTING

  33. DEPLOY: REPORTING FAILURES

  34. YOUR OWN BOT = SKY’S THE LIMIT

  35. YOUR OWN BOT = SKY’S THE LIMIT

  36. YOUR OWN BOT = SKY’S THE LIMIT

  37. YOUR OWN BOT = SKY’S THE LIMIT

  38. YOUR OWN BOT = SKY’S THE LIMIT

  39. YOUR OWN BOT = SKY’S THE LIMIT

  40. FUTURE FEATURES (WIP)

  41. @Z: FASTER BRANCH-SWITCHING/CHECKOUTS ➤ Using git worktrees ➤ Load all

    repositories on initial execution only ➤ fetch+worktree magic on branch change
  42. @Z: THREADING MICRO-MANAGEMENT ➤ fastlane scripts are broken down by

    relevant queues %FQMPZ %FQMPZ #&'03&
  43. @Z: THREADING MICRO-MANAGEMENT ➤ fastlane scripts are broken down by

    relevant queues %FQMPZ %FQMPZ "'5&3
  44. @Z: THREADING MICRO-MANAGEMENT ➤ fastlane scripts are broken down by

    relevant queues ➤ Run unrelated tasks in parallel ➤ No need to wait for whole deploy scripts before running the next
  45. @Z: BETTER, INFORMATIVE PROGRESS REPORTING

  46. @Z: BETTER, INFORMATIVE PROGRESS REPORTING

  47. @Z: OTHER FEATURES ➤ Self-updating ➤ Type-safe Swift config file

    ➤ User permissions (by Slack user ID, workgroup) ➤ Team-specific features ➤ Example: generating QR codes for testing universal deeplinks
  48. WRAP-UP ➤ We’re designing our build process to balance speed

    & convenience ➤ WIP ➤ Exploring Bitrise workflows to optimize micro-tasks ➤ Optimize our dedicated bot to fill in the gaps ➤ super-customizations ➤ Also hoping Bitrise would fill in some of those gaps
  49. THANKS FOR YOUR TIME! ➤ Twitter: @JohnEstropia ➤ Github: github.com/JohnEstropia