CI/CD: The tool that I didn’t know I needed

Tiewhan Smith
DVT Software Engineering
4 min readMay 19, 2020

As a student, fresh out of university, I thought I was ready for the development world, on the surface at least. Deep down, way past the imposter syndrome inherent in every developer, I knew that I was not ready at all. I had some idea of what most tools I would need to use; Source Control, Code Reviews, and Unit Tests. But the one tool I didn’t think I needed and the tool that I’ve ended up liking the most is a CI/CD pipeline.

For those that don’t know what CI/CD is, it’s Continuous Development/Continuous Integration. It’s a tool that automates a lot of processes to do with development. Ranging from test running to the deployment of archives to testers. Its biggest advantage, however, is that it solves the common trope of “But it works on my machine”.

A representation of steps that BitRise needs to follow when code is pushed to GitHub
CI/CD Pipeline/Workflow

Now, a popular CI/CD platform is BitRise and that’s the one I have been using since I graduated. Over the months I made it do quite a few things, they are all quite simple, but they are all important in making sure that quality software is produced. Earlier I mentioned a pipeline and this why. It’s like a pipe in that the previous step has to be done for the next one to go on.

These steps are tailored towards an iOS application but the principles stay the same for all fields of development. As you can see, there are various steps here. When I push code or make a pull request this pipeline automatically gets triggered thanks to webhooks and GitHub which starts the process.

The first 1 in this list being the cloning of the repository, I can’t run tests or code coverage on no code, now can I. With my code in place BitRise pulls some stuff from the Cache, this is just to speed up the process of compilation because sometimes it can take a while. 5 to 15 minutes is the range of time that I can expect.

Thirdly, I install my dependencies thanks to the CocoaPods installer, then there is a step to run any custom scripts that want (which I don’t) followed by a certificate and profile installer. This step is really important when you want to create a test version of the app for testers or you want to deploy to the AppStore.

The next 3 steps are quite important. BitRise creates the schemes necessary to run everything, for example, the Unit Test Scheme sets up the environment in such a way that allows quick and efficient testing. These schemes are then used by the next to step to actually compile and run these tests. Once they are done the reports are then uploaded to Codecov for analysis and are then pushed to wherever they need to go.

This is only a part of 1 of my pipelines for BitRise but there is so much more that you can do. 1 Of my pipelines automatically archives my code and allows testers to test the application (I use Firebase for this) and the last step in all my workflows is a simple Slack message to tell me, “Hey, we built it successfully” or “Shucks, we couldn’t build it”.

That is the meat on the bone that is BitRise. This is all to do with automation of processes. Without CI/ CD have to go to XCode and press archive and press some other buttons and then go to Firebase and then press more buttons just to get the application to the testers. That’s a lot of button pressing and clicking that I don’t want to do. By simply doing a pull request this all gets triggered and done automatically. BitRise takes my code, archives it, and informs the testers that a new version. Now the testers can do their testing and I can do my developing and they can then shout at me later. All this with only pressing 1 button.

A CI/CD Pipeline also works pretty great with testing. If your unit tests or UI tests fail, the build fails. If the build fails then their something wrong with my code. A recent experience I had with such a situation happened because of language versions. I had a custom framework, that was building fine in the IDE. My main project was building fine in the IDE. But BitRise failed and told me “pngData()’ has been renamed to ‘UIImagePNGRepresentation(_:)”. On the surface there’s a version mismatch but I couldn’t get it.

Long Story short, I missed a line that tells my framework what version to compile in so it defaulted to the lowest one. I would never have spotted this if it was not for CI/CD. Some poor user would have used it and boom, I’m out of a job. Now I don’t know about you but I like getting paid so please, save a user’s experience. Use CI/CD.

And as my mentor told me when I started, “If your company doesn’t have a CI/CD server, make one or quit on the spot”.

--

--