Friday, February 28, 2014

Continuous Delivery with Titanium, TestFlight, Jenkins, and Nomad

Continuous Deployment for TestFlight, Jenkins, Nomad
As an advocate for continuous delivery, building native mobile applications has always been a common problem faced for developers wanting to move fast, build something, measure the results and evolve their application. Incidentally, AppStores don't really provide an easy way of following lean entrepreneurship (ship fast, build, measure, learn). Things are getting better so I've decided to blog about our experience with continuous delivery with TestFlight, Jenkins, Nomad, and Titanium.

Some of the key benefits of continuous delivery include
- Being able to avoid large integration (merging) issues when feature branches have diverged extensively from what is on production. Smaller changes going into production frequently are a lot easier to resolve (fix or rollback).
- Deployment procedures can be tricky depending on the platform and the technologies you use -- automate everything so that you don't miss any steps within your deployment procedure
- Smaller changes going into production are easier to code review, it won't take up too much of an engineer's time

The Tools

- Titanium (being a JavaScript developer, it was easier for me to write in one language and generate iOS and Android applications for a minimum viable product).
- Jenkins (running Jasmine tests via NodeJS on any controllers, responds to webhooks when master changes, and pushes iOS binaries to TestFlight API)
- Nomad (Ruby-based tool which lets you generate iOS binaries)
- TestFlight (a platform for automating beta testing specifically iOS apps, getting user feedback, and getting crash reports/device diagnostics)

The Pipeline

- When developing a feature, branch off of master `(master) git checkout -b FEATURE-XYZ`
- Write the feature, pull in master, freely push to your feature branch and Jenkins will continue to run tests on your feature branch
- When a feature has been completed, use nomad to generate the IPA, commit the generated binaries depending if your Jenkins server is Mac OS X or not, submit a pull request to master, have it code reviewed.
- When the feature branch gets merged into master, we have a webhook that fires and Jenkins takes it off of master, runs tests, then ships the binaries to TestFlight via the TestFlight Jenkins Plugin
- This will automatically email all your beta users or specific groups of beta users (you can customize this list) to install that version that was just merged into master

Lessons Learned

- When you invite new beta users, don't forget to update your Mobile Provision Profile prior to merging into master by adding the new device identification numbers -- this will make it so that when they get emailed to install a new version of your app, they won't get a rejection error.
- The installation experience for beta users whether they are technical or not is absolutely amazing.
- If you ship to production 50+ times a day, your beta users may get a lot of email spam for installing specific builds.
- You won't need to commit the IPA to source code if your Jenkins box is Mac OS X (our Jenkins box is a Windows box since the platform runs CI on .NET code)

Wednesday, February 26, 2014

Engineering at Borentra

Software Automation and Pipeline... I wish software looked like this!

Built into the very DNA of Borentra is the essence of moving fast, failing fast, and evolving quickly. As the BORG would say -- "we adapt". From an engineering perspective, our tooling isn't complex at all -- we do our best to keep things lean and fast -- just so that we can quickly respond to customer feedback. That said, we are ever so focused on providing the best customer experience in the social space. Furthermore, in order to achieve these goals, we always need the latest tools that will allow us to ship faster and respond to the amazing feedback from our users.

For source code hosting, we use GitHub and we've adopted the GitHub Flow which basically means master is always deployable and we use feature branches when working on bug fixes, enhancements, or user feedback. Once a feature is ready to be deployed to production we send a pull request and if the code is good to go (code review and tests pass) we merge it into master. Once the merge happens, we have Jenkins listening for a webhook payload which basically means master needs to be tested on our CI server (Jenkins) and deployed to production (Azure).

A very lean process lets us ship fast. One of the first things we put in place was continuous deployment to Azure without even having a database! With a deployment pipeline in place, we are able to rely on so much automation to get from zero code to a feature on production within a short time span. As mentioned above, we are fully deployed on Windows Azure. We currently use Blobs, CDN, Azure Websites, SQL Azure for our web stack and then we have a few sprinkles of NodeJS and Neo4j for lookup services (Quick Add widget) that encapsulate power tools, trending books, Halloween costumes, Xbox360 games, PS3 games, Magic The Gathering cards, and Pokemon cards.

The last 4 months have been hectic but putting an upfront engineering investment for a deployment pipeline has been absolutely vital. Without speed and efficiency, you can't respond to solving problems that your target users are having — as an early stage startup, our biggest advantage is that we can quickly evolve the product so that we can continue to focus on increasing user engagement, as well as, user growth.

Have questions about what it's like to be in engineering at Borentra? feel free to tweet us on Twitter or mention us on our Facebook wall!

Sign up for Borentra today!