Continuous Android Deployment with Bamboo and HockeyApp

November 25, 2013

Making and Distributing Builds Manually is Boring

At MichiganLabs, we like to automate away redundant/mindless work so we can focus on providing value to clients and working on the interesting and difficult problems.

One of the very common tasks we do is build software; sometimes to give to clients, sometimes to provide versions for internal testing, sometimes just to see if it will build. Deployment to mobile devices can be complicated by the number of different devices that need to have the app downloaded and installed. In addition, the use of Git provides effortless branching but it can be difficult to keep track of all the different branches and what is currently being tested.

Enter Bamboo…

Atlassian Bamboo is a great build server which has tight integration with our instances of Jira (issue tracker) and Stash (Git repository). Bamboo can be configured to automatically track all the branches in Stash and build them. The integration is great and it makes it easy to see the status of each build.

Followed by HockeyApp

Once a build is complete, it’s sitting on the Bamboo server with no one able to access it except through the web interface. It’d be nice if a user could download the latest beta or an internal tester could put down the latest version. One option would be to upload the binary to a web server but that doesn’t provide much in the way of authentication or authorization and it can be hard to track versions and branches. Often, we only want clients to see beta builds but internally we should see all feature builds as well.

HockeyApp is a great service similar to TestFlight that allows Android and iOS apps to be uploaded and distributed. They provided a mobile app for users to see the latest build and provide feedback. There are a few features that set HockeyApp apart from other services we’ve looked at:

  • Ability to tag builds to restrict who can see them
  • Programmatically add release notes which we use to add feature branch name and commit number to each upload

Our Configuration

Setting the Android Version using Maven

Our Android projects use Maven for dependency management and builds. Bamboo has a plugin which runs Maven targets, so importing them in was straightforward. One of the things we wanted to do was have the branch name included in the Android version string so that a user could easily identify what branch they had installed. We didn’t want to edit the AndroidManifest.xml manually for each build, so we turned to the plugin to update it.

Bamboo’s Maven targets is

clean android:manifest-update install -Dandroid.manifest.versionName=${}

The android:manifest-update tells Maven to update the local manifest before it builds and passing in the versionName property sets the value. Bamboo has quite a few environment variables that can be used through the build configuration, ${} is the branch name of the current build. Now, every APK that is generated has the branch name embedded right in it.

Uploading to HockeyApp

Atlassian advertises that their iOS Plugin supports uploading to HockeyApp but doesn’t mention anything about using it with Android. Fortunately, the upload task doesn’t verify that file being uploaded is actually an iOS archive, so the plugin can be used just fine with Android APKs. It’s as simple as entering the API key and adding the task to the build stage.

The plugin allows release notes to be provided. Here too, we make use of Bamboo’s environment variables to provide valuable information. Our current settings are

Branch: ${}

Commit: ${bamboo.repository.revision.number}

Future Enhancements

Automated Tagging

The HockeyApp plugin currently doesn’t allow automated setting of tags so we manually have to go in and set them when we want to release to clients. This works fine since it doesn’t take long to do. HockeyApp has a public api so we can add a stage in the Bamboo publish process at some point.

Joshua Hulst
Joshua Hulst
Co-founder & Managing Partner

Looking for more like this?

Sign up for our monthly newsletter to receive helpful articles, case studies, and stories from our team.

Chicago Roboto 2022 Retrospective
Android Development

Chicago Roboto 2022 Retrospective

August 11, 2022

Scott Schmitz shares some notes of interest from talks at Chicago Roboto 2022, an Android community conference, that took place August 1-2.

Read more
MichiganLabs’ approach to software delivery: 3 ways delivery leads provide value
Process Team

MichiganLabs’ approach to software delivery: 3 ways delivery leads provide value

February 12, 2024

Delivery leads ensure the successful execution of custom software development. They build great teams, provide excellent service to clients, and help MichiganLabs grow. Learn what you can expect when working with us!

Read more
Business Model Canvas: Helping business leaders create meaningful digital products
Business Process

Business Model Canvas: Helping business leaders create meaningful digital products

January 17, 2024

When it comes to custom software, it’s easy to feel stuck between needing to deliver value quickly, while also ensuring meaningful, long-lasting results. Learn why the Business Model Canvas can help you identify the right digital product for your business needs.

Read more
View more articles