iOS - CI/CD using buddybuild

What is CI and CD? :

Saravanakumar G
4 min readDec 18, 2017

Continuous Integration: Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day(wikipedia). Each check-in is then verified by an automated build, allowing teams to detect problems early.

By integrating regularly, you can detect errors quickly, and locate them more easily.

Continuous Deployment is a strategy for software releases wherein any commit that passes the automated testing phase is automatically released into the production deployment(searchitoperations)

Continuous Delivery is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time. It aims at building, testing, and releasing software faster and more frequently(wikipedia)

Relationship between Continuous delivery and Continuous deployment:

Continuous delivery is sometimes confused with continuous deployment.

Continuous deployment means that every change is automatically deployed to production.

Continuous delivery means that the team ensures every change can be deployed to production but may choose not to do it, usually due to business reasons.

In order to do continuous deployment one must be doing continuous delivery

What is buddybuild?

A continuous integration, continuous deployment, and user feedback platform for iOS and Android development teams.

CI can be achieved by a VCS like github, gitlab, bitbucket.

Why buddybuild?

Buddybuild has

  • Easy integration to gitlab/github/bitbucket
  • All the processes(scanning for projects, SSH handling, building, testing and deployment) are handled by buddybuild itself

How CI works with buddybuild?

Once the developers push the code to their configured branches, the CI service(buddybuild) will pull the code from their repositories, clean, build, tests the project and then deploys the app to beta users/iTunes Connect.

Build generation requires wait times

When “git push” is given to specific branch,buddybuild will perform following,

  1. Creates a secure build environment
  2. Trigger a build of iOS app
  3. Run any Unit or UI tests — on physical devices if needed
  4. Prepare the app for beta testing or deployment to iTunesConnect

Building:

Sign up with your project repository,

buddybuild Sign Up

Authentication via Gitlab, Bitbucket would request full access (read, write access) from the account

Once the git service is chosen and signed-in, buddybuild will automatically scan for your project and identifies whether it is iOS/Android/Web project

buddybuild environment set up

After the setup is completed, buddybuild lists all the builds and branches along with their commit id, commit message, etc.,

Builds dashboard

Automatic build generation can be enable/disabled. Build generation occurs in buddybuild server itself without any plugin or Xcode integration.

More > App Settings > Build settings

Testing:

Testing is mandatory to confirm whether everything in the app works as expected. we have to enable tests on branches. Test scripts/Custom scripts can be run on buddybuild. Testing can be done at any of following stages,

  • After cloning the repo
  • Before building
  • After build generation

To run a custom script after the cloning, we need to create a shell file at our repo root directory and name it buddybuild_postclone.sh and the test scripts can be executed.

Xcode Tests

Deployment:

The build can be deployed to,

  • Individual/user groups
  • iTunes Connect

Deploy to an individual/user groups:

Deploy to beta users

(ii) Deploy to iTunes Connect:

To deploy the build directly to iTunes Connect. The following configurations has to be done,

  • Developer account has to be configured
  • Deploy can be done for each build/manually/scheduled
  • And project schema has to be chosen
Deploy to iTunes Connect

If you have any questions, let me know in comments. If you find it useful, please clap 👏🏻 for recommendations 😊

--

--