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

Unity Cloud Build API: Build to specific commit, not most recent commit?

Discussion in 'Unity Build Automation' started by JustJunuh, Dec 7, 2020.

  1. JustJunuh

    JustJunuh

    Joined:
    Jun 3, 2015
    Posts:
    52
    Hey there!

    I'm currently working on some automation for our production, and I'd like to do something that I'm not sure is possible.

    Currently, we are using Plastic SCM and have connected it to Unity Cloud Build. (Our builds are currently failing right now, but that's a separate topic ;)) I have the webhooks set up so that on a new check-in, we fire a webhook to our WordPress site. Then through some simple PHP script, we create a new post that outlines the current check-in: it looks like so.

    upload_2020-12-6_18-54-9.png

    And after this post is generated, we send an API call to Unity Cloud Build to generate a new build. Then, once the build completes, it updates a link on this page to the fresh build made on this current changeset. At least, that's the plan anyway. Not quite fully functional yet.

    The problem that I've run into is that Unity Cloud Build (free trial) seems to only queue one build max while one build is currently building. We do not need concurrent builds. However, we do need a build for every changeset. I see potential issues if we got 3 back-to-back check-ins. Take this example:

    Check-in A: "Make super jump"
    Building starts.
    Check-in B: "Make rocket jump"
    Build queued, build already in progress.
    Check-in C: "Make galaxy jump"
    ERROR: Build is already queued

    Anytime I send a request to queue a new build when one is already queued, it returns an error. So then, when build A is done, does build B create from Check-in B or Check-in C? It was queued when Check-in B was sent in. However, Check-in C is the latest.

    If UCB can only handle one queued build at a time, that's fine. I can create an internal queue system on our WordPress site. All I want is the ability to create a build at a specific check-in, even if it isn't the latest check-in.

    Is this possible?
     
  2. JustJunuh

    JustJunuh

    Joined:
    Jun 3, 2015
    Posts:
    52
    Hey just wanted to bump this thread. To restate, is there any way to tell UCB to build from a specific changeset rather than the "latest" changeset on the specified branch?
     
  3. rajivrao

    rajivrao

    Unity Technologies

    Joined:
    Feb 19, 2019
    Posts:
    111
    Hi @JustJunuh! Unfortunately UCB can only build from the latest changeset at the moment.
     
  4. JustJunuh

    JustJunuh

    Joined:
    Jun 3, 2015
    Posts:
    52
    Thanks for the reply! Are there any plans to support this feature? Or a roadmap? Thanks!
     
  5. ABerlemont

    ABerlemont

    Joined:
    Sep 27, 2012
    Posts:
    66
    Is it do-able now ? Or will it be a feature in the futur ?

    Cloud build shouldn't/doesn't need to make a build for every commits. Like if you just cleaned some comments there is no need for a cloud server to start consuming energy and build for 3 different platforms ...
     
  6. rajivrao

    rajivrao

    Unity Technologies

    Joined:
    Feb 19, 2019
    Posts:
    111
    Hey @JustJunuh and @ABerlemont you should be able to do this now! We recently released this feature. See attached image. Let me know if that's what you were referring to.

    upload_2021-11-12_13-24-15.png
     
    hsallander and JustJunuh like this.
  7. JustJunuh

    JustJunuh

    Joined:
    Jun 3, 2015
    Posts:
    52
    THAT'S SO COOL. Thanks!!