How to setup CircleCI and Slack with ConstructVR

Yesterday, we announced that we’ve released CircleCI integration for GearVR apps. In this post, I’ll go over how to setup your circle.yml file and bash script to hook into your current CircleCI integration.

One of the biggest snags we hit was with the version of curl that comes out of the box with the CircleCI machines. You’ll notice in the example circle.yml file, we’ve upgraded wget and curl. It turns out the default version of curl (7.22) needs to get upgraded to 7.35+ so that we can do TLS handshakes in accordance with AWS SSL certificates.

Below is how the Circle.yml file looks:

In the pre block, we use sudo apt-get update && sudo apt-get install curl wget because we need to upgrade the version that comes out of the box when CircleCI’s containers come up. One thing to note is that you don’t actually need to use NodeJS — I used it for the example because it was the quickest way for me to have a test runner go through CircleCI on my GitHub repo.

Below is what the shell script looks like.

In the above example, you can specify a Slack channel (slackChannel) and your Slack web hook url (slackWebhookUrl) so when it finishes attaching your account-bound Oculus Signature files to the APK, it can notify you as soon as the build is done. You might notice, “where’s the Slack token?” well this is something you set when you log into ConstructVR.

Additionally, you can specify an App Identifier (https://nexus.constructvr.io/api/apps/{appId}?api-key=…..), and it will just rebuild that particular application — This is useful if you’ve added or removed Oculus Signatures that are associated to your account.

And that’s it! If you have a Unity project, you won’t have to change anything to your project directory except to add the few lines in your Circle.yml file and add the shell script.

If you’re building GearVR applications and you want to automate your build and distribution process with CircleCI and Slack — Check out ConstructVR and get started today!