How to retrieve and return Unity license in TeamCity Cloud build

Completed

EDIT : I figured this out. 

I had to create 3 Unity Steps.

Step 1 : Retrieve License
Step 2 : Build
Step 3 : Return License

Passing in the relevant params per step, as per 
https://docs.unity3d.com/Manual/CommandLineArguments.html

-----------------------------------------------------

I am trying to understand how to retrieve a Unity license, so I can build with my CI/CD pipeline on TeamCity cloud, and then return the license. 

The TeamCity Unity runner doesn't share any information on how to set this up, and there are no fields. 
The Unity documentation says, run the following command to retrieve the license for the build...

"C:\Program Files\Unity\Editor\Unity.exe" -batchmode -username name@example.edu.uk -password XXXXXXXXXXXXX -serial E3-XXXX-XXXX-XXXX-XXXX-XXXX –quit

And then it mentions to run the following command, to return the license, once the build is complete

"C:\Program Files\Unity\Editor\Unity.exe" -quit -batchmode -returnlicense

So I am trying to add the following command line option for the command line arguments..

-batchmode -username email@email.com -password myPassword -serial SB-XXX-XXX-XXX-XXX –quit -returnlicense

But I still get a license error, here is the build log..

Step 1/1: Unity (5s)
[22:27:23][Step 1/1] Starting: "C:\Program Files\Unity\Editor\Unity.exe" -batchmode -projectPath ./ -buildTarget Win64 -nographics -batchmode -username email@email.com -password myPassword -serial SB-XXXX-XXXX-XXXX –quit -returnlicense -quit -logFile



[22:27:23][Step 1/1] in directory: Z:\buildAgent\work\dbccf4b3ef2d24ff



[22:27:23][Step 1/1] [Licensing::Module] Channel doesn't exist: "LicenseClient-builduser"



[22:27:23][Step 1/1] [Licensing::Module] Successfully launched the LicensingClient (PId: 5752)



[22:27:28][Step 1/1] [Licensing::Module] Timed-out after 5.00s, waiting for channel: "LicenseClient-builduser"



[22:27:28][Step 1/1] IPC channel to LicensingClient doesn't exist; falling back to Legacy licensing



[22:27:28][Step 1/1]



[22:27:28][Step 1/1] LICENSE SYSTEM [202159 10:27:28] Failed to return license: Unity license has not been activated, and cannot be returned.



[22:27:28][Step 1/1] Exiting without the bug reporter. Application will terminate with return code 1



[22:27:28][Step 1/1] Process exited with code 1



[22:27:28][Step 1/1] Process exited with code 1 (Step: Unity)
[22:27:28][Step 1/1] Step Unity failed

I'm not sure I've set this up right, I have double checked my credentials and Unity license key, so that is all correct.
Can someone point me in the right direction. 
Thanks

Please sign in to leave a comment.