The talk given on Mobile Optimized 2017 Conference, describing our way of moving away from a build system based on Jenkins with dedicated build slaves, to tightly coupled Gitlab with Docker containers and VMWare Virtual Machines as it's runners.
Web Start ✱ Command execution on the master ✱ Keychains and provisioning profiles injection: ✱ Sharing credentials with Slaves? ✱ Storing PP and certificates manually on master? Why to bother? 5
to audit session 0x186a7: 1: Operation not permitted [14:38:26] xcodebuild[665:5094] Failed to remove job com.apple.CoreSimulator.CoreSimulatorService via launchctl. Status: 256 : exited? 1,1 signaled? 0,0 stopped? 0,1 [14:38:26] xcodebuild[665:5094] Failed to locate a valid instance of CoreSimulatorService in the bootstrap. Adding it now. [14:38:27] xcodebuild[665:5094] *** Assertion failure in - [SimServiceContext reloadServiceIfMovedOrAbortIfWeAreInval id], /BuildRoot/Library/Caches/com.apple.xbs/Sources/ CoreSimulator/CoreSimulator-209.19/CoreSimulator/ SimServiceContext.m:536 ❌ ** INTERNAL ERROR: Uncaught exception ** Uncaught Exception: The loaded com.apple.CoreSimulator.CoreSimulatorService job does not match our expectations: pathOfLoadedJob: Why to bother? 9
Development slowed down ✱ Updating slaves separately ✱ Separate physical machines ✱ Why not to solve it with a self-contained CI/CD system? Why to bother? 11
Paid per user ✱ Supported open source ✱ Available as hosted GitLab.com or githost.io service ✱ GitLab Runners ✱ Covering almost whole development process GitLab for the rescue 13
bundled Docker Registry) ✱ Trivial to configure (Have you ever configured the Jenkins slave?) ✱ Single binary, written in Go without external dependencies GitLab for the rescue 16
chmod +x /usr/local/bin/gitlab-runner tg@MacBook-Pro:~$ sudo gitlab-runner register Running in system-mode. Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/): https://gitlab.com/ Please enter the gitlab-ci token for this runner: DDDDDDDDDDDDDDDD Please enter the gitlab-ci description for this runner: [MacBook-Pro-tg]: ios-coordinator Please enter the gitlab-ci tags for this runner (comma separated): ios-coordinator,ios Whether to run untagged builds [true/false]: [false]: false Whether to lock Runner to current project [true/false]: [false]: false Registering runner... succeeded runner=DDDDDDDD Please enter the executor: virtualbox, kubernetes, docker, docker-ssh, parallels, shell, ssh, docker+machine, docker-ssh+machine: shell Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! GitLab for the rescue 18
virtual machines) ✱ using Docker containers ✱ using Docker containers and executing job over SSH ✱ using Docker containers with autoscaling on different clouds and virtualisation hypervisors ✱ connecting to remote SSH server GitLab for the rescue 20 via: https://docs.gitlab.com/runner/
iTC and Developer Portal ✱ Automating taking localised screenshots on variety of devices ✱ Uploading binaries, metadata and screenshots to iTC Encapsulating with Fastlane 23
Encapsulating Gradle tasks within Fastfile ✱ Single interface for both platforms ✱ Automating taking localised screenshots on variety of devices ✱ Uploading binaries, metadata and screenshots to Google Play Encapsulating with Fastlane 24
Fastfile ✱ Appfile ✱ and more ✱ The same CLI for all platforms: ✱ fastlane lane test ✱ fastlane lane beta ✱ fastlane lane store Encapsulating with Fastlane 25
Docker Registry ✱ Docker image for each API version ✱ Isolated ✱ Scalable ✱ Ability to run: ✱ with cache (e.g. dependencies) ✱ clean build Virtualise everything 28
with different Xcode versions ✱ Saving disk space ✱ Only serial execution of builds on host ✱ Helper script on host Mac, launching selected snapshots ✱ Each snapshot has it’s own runner installed Virtualise everything 30