Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to get build/commit ID from Unity Cloud Build

Discussion in 'Unity Build Automation' started by fischer_ag, Feb 6, 2015.

  1. fischer_ag

    fischer_ag

    Joined:
    Nov 19, 2014
    Posts:
    23
    Hi!

    We use our own method to get commit ID from our git repository. We read it from .get/HEAD file on local machine. But on UCB it can't find this file. Could you please show me, how to get this file? Or maybe you have some methods to get commit ID or even build ID?

    It is very useful for testing.

    Thanks!
     
    hypeNate likes this.
  2. hypeNate

    hypeNate

    Unity Technologies

    Joined:
    Apr 4, 2014
    Posts:
    272
    Yes we do! What you are looking for is the "Build Manifest":

    https://build.cloud.unity3d.com/support/guides/manifest

    This is a package that is inserted into your project when it is compiled that contains the following info:
    • scmCommitId: Commit or changelist built by UCB
    • scmBranch: Name of the branch that was built
    • buildNumber: The Unity Cloud Build number corresponding to this build
    • buildStartTime: The UTC timestamp when the build process was started
    • projectId: The UCB project identifier
    • bundleId: (iOS and Android only) The bundleIdentifier configured in Unity Cloud Build
    • unityVersion: The version of Unity used by UCB to create the build
    • xcodeVersion: (iOS only) The version of XCode used to build the project
    • cloudBuildTargetName: The name of the project build target that was built. Currently, this will correspond to the platform, as either "default-web”, “default-ios”, or “default-android".
    Please try it out and let us know how it goes!
     
    GarthSmith likes this.
  3. fischer_ag

    fischer_ag

    Joined:
    Nov 19, 2014
    Posts:
    23
    @hypeNate, thanks! I will try to use it!
    So, then another question. How can I exclude this manifest file for Release/Store builds?)
     
  4. hypeNate

    hypeNate

    Unity Technologies

    Joined:
    Apr 4, 2014
    Posts:
    272
    Currently the Build Manifest is always included, but if you'd like to submit your project to the app stores without it, we recommend building the final version of your project locally and uploading it from your local machine.
     
  5. EnduvoJD

    EnduvoJD

    Joined:
    Aug 12, 2016
    Posts:
    40
    In post export, I call the Unity Cloud API to get my build information which includes the changeset. The commit messages coming from the Cloud API response don't seem to have any newlines, so trying to put together a changelog from this doesn't turn out well. Do you have any UCB-related solutions for this, or should I just get the info straight from my repo instead?


    Send changelog to Slack on post export

    Including body text in expected format to test handling this in the changelog. It does not do to leave a live dragon out of your calculations, if you live near him.

    Fixes PL-1030
    Comment on issue PL-1031


    becomes

    Send changelog to Slack on post exportIncluding body text in expected format to test handling this in the changelog. It does not do to leave a live dragon out of your calculations, if you live near him.Fixes PL-1030Comment on issue PL-1031
     
  6. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,077
    I'm not certain but I had a similar issue when sending data to Microsoft Teams. It didn't like new lines as it was html based. I replaced '\n' with '<br>' and it fixed it.
     
  7. EnduvoJD

    EnduvoJD

    Joined:
    Aug 12, 2016
    Posts:
    40
    Yeah, with JSON, you'd wanna escape newlines before sending them. I'm not sending the data (yet) though. I'm getting data from Unity Cloud Build API. The data returned by the Unity API doesn't include any escaped newlines in the strings (the commit messages).
     
  8. EnduvoJD

    EnduvoJD

    Joined:
    Aug 12, 2016
    Posts:
    40
    I tested this in Postman as well. The Unity Cloud API returns the commit messages without newlines characters.

    The Gitlab API returns these commit messages with newline characters.
     
  9. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,077
    Ah, ok - that's a shame. Probably worth submitting a ticket to the cloud build support team, I've found them very helpful in the past and quick to fix any issues like that.