Bitrise: Mobile CI Service

With the small iOS team at Hipmunk, having to maintain a box to run Xcode Server would have been costly in terms of:

  • Buying hardware
  • Upgrading/maintaining the hardware
  • Keeping the OS/software up to date

Furthermore, we’d have to find a separate solution for our Android team and gain expertise on maintaining their CI as well.

We ended up deciding to use Bitrise, a continuous integration and delivery service designed primarily for mobile platforms.

Which Plan?

We’d started out with the Standard Plan, which gave us:

  • 12-15 minute builds
  • 2 concurrencies
  • $1200 annual

That’s definitely a lot cheaper than self-hosting our own machine and spending the time to maintain it!

In my mind, generally, a 10 minute build time is a good number to stay under. Furthermore, with 2 engineers on each platform, we generally needed bandwidth for each engineer to run a build concurrently without slowing each other down. Being able to run a build for release during tighter times was important. Maybe we didn’t need 6 concurrents, but we thought 4 would generally give us enough room to work with.

We started looking at Bitrise’s Elite Plan with its beefier boxes, and we were able to do a trial to get some numbers out:

  • 8-9 minute builds
  • 4 concurrencies
  • $4800 annual

These costs were minor in comparison to the time we were saving on the team and the value we were getting out of quick iteration of our commits. Definitely still cheaper than running and maintaining our own machines.

It made a lot of sense to go ahead and upgrade to the Elite Plan, so we moved forward with that, and months later continued to be happy with our decision.

Running on Multiple Stacks

When Apple releases a new major version of Xcode and accompanying SDKs, you generally need to build your app on the new version and ensure you’ve handled all the warnings, deprecations, and sometimes bugs that crop up because of it.

A strategy I like to use here is to open a PR for the new changes on a branch like xcode11 and start pushing changes there. I can then setup Bitrise to use the new stack and ensure that our CI will continue operating properly with the new version.

Bitrise does a great job of making sure beta versions of Xcode are available as soon as possible, so you can get running on the new versions within days of Apple’s announcements.

UPDATE: John Sundell’s written a great post on not needing to branch to handle the two Xcode versions. Very clever! I haven’t given it a try yet, but I think it makes a lot of sense and will report back after giving it a shot.

Gotchas

We were using a fastlane lane to run our tests, and we would intermittently get failures with the error:

Testing failed:
Command CompileSwift failed with a nonzero exit code
Command CodeSign failed with a nonzero exit code
Testing cancelled because the build failed.
** TEST FAILED **

We switched over to using Bitrise’s own Xcode Test for iOS Step, and haven’t had any issues since. I saw the same phenomenon when using Bitrise for little countdown.