Continuous integration made easy with Bitrise

I recently fell in love with Bitrise, a delightful and flexible continuous integration/delivery platform with so much potential. If you'd like to know why and try it out right away, just read on.

Sign up..

.. and see how you are able to set up a GitHub project to the build system in under a minute. I used a simple basic iOS project in Swift with all beta dependencies and Carthage, but if you use something special like React Native, you shouldn't be worried either. Bitrise can handle it.

It was surprisingly straightforward to put things together, see below.

Setting up a new on Bitrise

After this, I set up some necessary things like adding a certificate and a provisioning profile for my app. When I had everything in place, I started to build up my primary workflow. The workflows are built up from steps you can define, reorder, compose, etc.

Bitrise workflow

Anything specific I had to add to this project was running carthage to set up my dependencies before the unit tests run, and an Xcode select step even before that, which is currently the stable, but I can go there anytime and change it with a click. I really took advantage of the Xcode version selector step, since I needed to build for a beta and a new Swift version two days after it came out. Since the step sets xcode-select I also didn't have to worry about breaking Carthage building dependencies with the brand new Swift 2.0.

You can connect workflows to run after and/or before your primary one.

Trigger builds

I use master pushes and pull requests on my app as automatic triggers. It's also possible to specify which workflow to run for each branch. You can create triggers with a simple POST via the Build trigger API. It's pretty straightforward to customize it manually as well:

Builds

Make your own step

If you need two lines of bash between your steps, you can just add a generic script step and write the code in it, or add a remote script step with the link. What's even more cool is that you can distribute your own step and make it part of the Bitrise StepLib (or your own StepLib) with stepman. If bash is not your friend, you can write your step in Go, Ruby, or Swift. For my carthage step I created a GitHub repo first, then a step.sh as follows.

Then it seemed too specific, so I added the command as a parameter and set no-use-binaries optional. There were requests for adding a working directory parameter and the possibility of making the output verbose so it has been added as well recently.

From the other end it looks like this:

Carthage command is bootstrap by default, the binaries flag is false, working_dir is your project root and verbose_output is not set. The value options appear as a dropdown when using it via the hosted Bitrise. Easy, right?

Carthage step in production

CLI

Use the Bitrise CLI, the runner is all open source now. It comes handy in case you'd like to run bitrise on your own machine and reproduce exactly what happens. I added a bitrise.yml to my project root and just shot a bitrise run primary which is my only workflow and examined the results. It helped a lot when I tested my new step. It's also possible to add the bitrise.yml to the step's root and just reference it relatively with - path::./: so you can test locally. When I was done, I ran stepman share and followed some basic instructions (forking the steplib repo and sending a PR). After the merge it became live immediately and now you, too, can use Carthage with Bitrise.

Just add [email protected] to your bitrise.yml and set the optional parameters if needed.

Am I missing something?

It would be so great to have public build information so people can check out why my open source project builds are failing without having them on the team.

About & more to come

There are so much more you can do with Bitrise, I suggest to check out the Bitrise DevCenter, where you can find all the docs and resources you need. If you are interested in building for Android, it's available now. In case you need support, join the Bitrise Slack, they are very helpful and have an incredible response time. Follow Bitrise on Twitter, I'm always up-to-date about the VM updates through their #status tweets or the status page.


Special thanks go to @birmacher & @ViktorBenei.

Show Comments