Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Unity Cloud Build To HockeyApp

Discussion in 'Unity Cloud Build' started by MatmiDeveloper, Aug 21, 2016.

  1. MatmiDeveloper


    Sep 27, 2013
    Unity Cloud Build To HockeyApp
    A NodeJS application to automate binary deployments from Unity Cloud Build to HockeyApp.

    Note; This is an initial release which is functional, but needs refactoring.

    App Flow
    1. Receive a webhook from Unity Cloud Build to notify a build is ready.
    2. Get the build details from the JSON payload within the webhook.
    3. Download the app binary from the Unity Cloud Build API.
    4. Upload the app binary to HockeyApp.
    • Setup a Unity Cloud Build account and project.
    • Setup a HockeyApp account. HockeyApp will use the app package name to detemine which project to upload to.
    1. Clone this repository.

    2. Add API keys to '.env' for both Unity Cloud Build and HockeyApp.
      • UCB API key can be obtained here.
      • HockeyApp API key can be created here. Be sure to create a key 'Upload' rights (e.g. anything above 'Read Only').
    3. Deploy.
      • Have only tested running on Heroku.
    4. Setup the Unity Cloud Build webhook.
      • Within UCB, view your app. Click 'Notifications', then 'Add New' and enter your app URL with '/build' appended. E.g. 'http://[appurl]/build/'
      • Use a tool like Request Bin to test web hooks from UCB, ontain the payload and test requests to '/build/'.
    • If you use Slack, integrate UCB and HockeyApp to be notified when a new build is ready and has been pused to HockeyApp. See screenshot above.
    • You don't need to setup the app on HockeyApp, if you upload the binary it will automatically create a new app instance.
    • Configure HockeyApp to automatically notify users after the binary has uploaded. See the 'notify' variable within the 'uploadToHockeyApp()' function. HockeyApp API
    • Clean up and comment codebase.
    • Populate HockeyApp release notes with Git commit message.
    • Add logging feature to show builds processed and deployed.
    • Integrate job system to manage/prioritise jobs and view jobs in progress.
    Copyright 2016 Nathan Brodbent

    This software is licensed under Apache License 2.0.
    FaetterJens likes this.
  2. liortal


    Oct 17, 2012
    Pretty cool. We have been thinking of switching our crash reporting service and HockeyApp was one of the names i have on my list of services to check.

    Can this app be generalized to work with other services as well?
  3. MatmiDeveloper


    Sep 27, 2013
    Sure, this could easily be adapted to deploy to another service providing they have an API that allows you to upload the binary.

    HockeyApp is great. It will also group crashes then create tickets in your bug tracker system automatically.
    Although, our favourite feature in the HockeyApp SDK is the ability to notify and update apps within the app itself.
  4. l7ocHoliday


    Aug 29, 2014

    Thank you for this and providing it on GitHub. We used Hockeyapp on our last project and it was a great help.

    However, I'm not able to get this properly setup. I keep getting an error when I test the Webhook request.

    Code (JavaScript):
    1. 017-10-23T11:46:49.044198+00:00 app[web.1]: TypeError: Cannot read property 'api_self' of undefined
    2. 2017-10-23T11:46:49.044201+00:00 app[web.1]:     at /app/index.js:56:37
    3. 2017-10-23T11:46:49.044202+00:00 app[web.1]:     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    4. 2017-10-23T11:46:49.044203+00:00 app[web.1]:     at next (/app/node_modules/express/lib/router/route.js:131:13)
    5. 2017-10-23T11:46:49.044204+00:00 app[web.1]:     at /app/node_modules/body-parser/lib/read.js:129:5
    6. 2017-10-23T11:46:49.044208+00:00 app[web.1]:     at invokeCallback (/app/node_modules/raw-body/index.js:262:16)
    7. 2017-10-23T11:46:49.044208+00:00 app[web.1]:     at done (/app/node_modules/raw-body/index.js:251:7)
    8. 2017-10-23T11:46:49.044209+00:00 app[web.1]:     at IncomingMessage.onEnd (/app/node_modules/raw-body/index.js:307:7)
    9. 2017-10-23T11:46:49.044210+00:00 app[web.1]:     at emitNone (events.js:86:13)
    10. 2017-10-23T11:46:49.044210+00:00 app[web.1]:     at IncomingMessage.emit (events.js:185:7)
    11. 2017-10-23T11:46:49.044211+00:00 app[web.1]:     at endReadableNT (_stream_readable.js:974:12)
    I setup the .env with my API keys for UCB & Hockeyapp. Then I also setup environment variables inside of Heroku using this

    Never used Node.js before and I'm still a noob when it comes to webhooks. Any ideas would be much appreciated.

    SeanMcTex likes this.
  5. oldSerge_bxp


    Sep 8, 2017
    Hey man, just had this problem.

    Check the following in your Unity Cloud webhook:
    1. URL= [YOUR APP URL]/build (NOT ([YOUR APP URL]/build/")
    2. Make sure that "Include Share Link" is enabled