Slide 1

Slide 1 text

build eureka.swift ✗ Bitrise Muukii | Eureka, Inc 2019 March Thoughts about build flow

Slide 2

Slide 2 text

Hiroshi Kimura Muukii Twitter @muukii0803 iOS Engineer Head of Development, Pairs Global

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

1BJSTʹ͍ͭͯ !4

Slide 5

Slide 5 text

4PVUI,PSFB Japan Taiwan No.1 2017 release No.1 !5 1BJSTʹ͍ͭͯ ల։ࠃ ̐ͭͷϓϥοτϑΥʔϜ CONFIDENTIAL INFORMATION: Not for Public Distribution - Do Not Copy

Slide 6

Slide 6 text

! " # eure/pairs-ios eure/pairs-gl-ios I’m here $

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

• Summary • Current build flow of Pairs Global • We are moving our build flow to the cloud Contents

Slide 9

Slide 9 text

Summary

Slide 10

Slide 10 text

• Building on cloud CI/CD took a very long time until now • But now • Swift compiler is faster (4.2 batch mode) • We can build large applications on cloud CI/CD Summary

Slide 11

Slide 11 text

Current build flow of Pairs Global

Slide 12

Slide 12 text

1. Run UnitTests 2. Archive 3. Upload to AppStoreConnect 4. Create git-tag using timestamp 5. Upload artifact to git-tag on GitHub Flow

Slide 13

Slide 13 text

• UnitTest • Logic • Benchmark • UITest • Login flow Run Tests

Slide 14

Slide 14 text

• Beta • For Testing (Internal / External) • Release • For Release and for Testing (Internal / External) Archive

Slide 15

Slide 15 text

• We can install beta / release apps with TestFlight • Using Internal / External Testers Upload to AppStoreConnect

Slide 16

Slide 16 text

Release Beta

Slide 17

Slide 17 text

• After successful upload to AppStoreConnect • Create a tag with environment and timestamp • v50.4.0-appstore.53240316.1 • v50.4.0-beta.52968482.0 Create git-tag using timestamp

Slide 18

Slide 18 text

• .xcarchive • .app for iOS Simulator Upload artifacts to GitHub

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

App for simulator. You can drag and drop to its home screen.

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Sample code to create app for simulator

Slide 23

Slide 23 text

We are trying to use Bitrise

Slide 24

Slide 24 text

• We created a large application • Over 140000 lines Swift Code • CI/CD took over 1 hour to archive or time out • Building the code of CocoaPods • Building the code of Application With Swift2.x

Slide 25

Slide 25 text

So, we got…

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

• Jenkins is an open source automation server written in Java • Powerful & Flexible Jenkins

Slide 29

Slide 29 text

• Setting up is too hard for us * • Does not have cool UI Design * • https://ci.swift.org/ is better. But,

Slide 30

Slide 30 text

I just need to run git polling and shell-script.

Slide 31

Slide 31 text

• https://github.com/eure/Tower • Watch branch with polling • Run shell-script, if Tower finds new commits on a branch • That’s it. But actually just what I needed. eure/Tower instead of Jenkins

Slide 32

Slide 32 text

• Creating Server Software has some difficult points. • Manage child-process • Zero memory leaks • To keep working as long as possible But,

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Jenkins Blue Ocean

Slide 35

Slide 35 text

• Multi-branch Pipeline • Blue Ocean is a plugin • Jenkins + Blue Ocean = Better UI Design (Better) Jenkins + Blue Ocean

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

• Around 15min (fastlane build_app) • Then, upload to AppStoreConnect Archive Time on Mac Pro

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

• Management cost of Jenkins is high • With Bitrise, we can see the status of tasks from online We are trying to use Bitrise

Slide 41

Slide 41 text

• Around 25min (fastlane build_app) Archive Time on Bitrise

Slide 42

Slide 42 text

• Longer archive time, but it’s no big deal • Incredibly fast compared to few years ago Awesome

Slide 43

Slide 43 text

• Carthage creates prebuilt frameworks. • No need to build them for archive • Most of archiving time is building frameworks managed by CocoaPods in our project • Recently, we came back to CocoaPods We can reduce it with Carthage

Slide 44

Slide 44 text

• LLDB does not work well with Carthage. • "error: Couldn't IRGen expression, no additional error" • To create an umbrella framework that includes many static frameworks • App launch time will be faster by reducing dynamic linking. Why we use CocoaPods

Slide 45

Slide 45 text

• Easier to debug inside libraries. • We can notice debug logs from libraries. Why we use CocoaPods

Slide 46

Slide 46 text

Every tool is improving day by day We will never stop finding a better way

Slide 47

Slide 47 text

Thank you! build eureka.swift ✗ Bitrise Hiroshi Kimura | Eureka, Inc. 2019 March