mindcandy / Teamcity-unity3d-build-runner-plugin

A Teamcity plugin for building Unity3d projects. NOTE: this has an MIT license so feel free to copy / adapt as you need to.
107 stars 59 forks source link

Incompatible Agents #24

Open tylo opened 9 years ago

tylo commented 9 years ago

I am using TeamCity version 9.1.1 (build 37059)

So I've gone through a lot of hoop jumping updating a TeamCity installation I inherited from an old co-worker, and not understanding that TEAM_CITY_DATA_PATH was not where I thought it was...but after a few hours I did eventually install this plugin correctly and removed the old one...

I even had to uninstall a buildAgent that was stuck in an endless loop of failed updates. Reinstalling it fixed that.

Now I have my final hurdle, and sadly will go to sleep with unresolved conflict, because I am absolutely stumped.

When I try to run a build, I am met with the following error and reason:

Incompatible runner:
Unity

Unmet requirements:
unity.latest exists

I even shutdown the Agent, deleted its plugin folder, and restarted it (thus forcing an update to the Agent). I was paranoid it was somehow still getting the old Unity plugin. I understand it pulls the data from the TEAM_CITY_DATA_PATH and installs some plugins into its own local directory.

However, this still happens. I have no idea if it is anything I can fix. I have also tried specifying the Unity version I have installed, but that also does not work.

If it helps, I have Unity 5.1.3p1 installed. I'm not sure if it is required that I have a non-patch release installed with the way unity.latest currently works. Explicitly typing in 5.1.3p1 also did nothing.

EDIT: I just noticed that, for some reason, Unity does not appear as one of the supported Build Runners in my Agent's Build Runners tab. I am unsure how this is possible, because it is being added to the plugins folder, I can see it there.

EDIT 2: I was just looking through my teamcity-agent.log file, and came across this error.

[2015-09-04 01:02:18,552]  ERROR -    jetbrains.buildServer.AGENT - Exception getting finding unity versions :\Applications 

However, it is an error you would expect, running on a Windows installation. The rest of the log claims that unityRunner is indeed running, so I am unsure if this has anything to do with the problem. I imagine not, or else it wouldn't work for anybody on Windows.

MitchellBurton commented 9 years ago

Sounds like you are running in to the same problem I had. Take a look at my PR: #22. You will also need #20 to build it.

I might put a prebuilt version up somewhere if I can be bothered this coming weekend, seen as how it is an issue for people.

radiatedpixel commented 9 years ago

i'm having the very same issue. any chance you'll release a fixed prebuilt version?

PIGOS commented 8 years ago

Same issue. PR: #22 doesn`t work for me. Anyone have a idea?

tylo commented 8 years ago

I gave up myself and ended up just ran my own commandline with custom variables filled in per project. That's essentially what this plugin does, but it has added convenience of monitoring Unity versions.

PIGOS commented 8 years ago

Yes, but right now it doesn't work (for me) so... Can you send me your commandline? this will help me, and I will not repeat the same work you have already done. Thanks

tylo commented 8 years ago

cmdline

hex commented 8 years ago

Text version, replace or remove -buildTarget webgl with the desired platform, also check the paths.

"C:\Program Files\Unity\Editor\Unity.exe" -batchmode -quit --build_path=C:\Builds\WebGL -projectPath %teamcity.build.checkoutDir% -buildTarget webgl -executeMethod BuildHelper.BuildWebGL -cleanedLogFile C:\TeamCity\buildAgent\temp\buildTmp\cleaned-%teamcity.build.id%.log -nographics
weltenbauer commented 8 years ago

Possible workaround for the issue:

ohmaya commented 8 years ago

@weltenbauer

Although you got 2 thumb-ups, it's hard to understand how this can be a workaround (how this can make an incompatible runner compatible) and actually it doesn't work for me.

AliZaibVR commented 7 years ago

Hello Guys I am new to TeamCity and running into exactly the same issue. As @tylo suggested to make Unity build using command line. Need to where and how can I put command line in TeamCity to make Unity's build. Quick feedback would be great

hex commented 7 years ago

Hi @AliZaibVR

Just add a build step with the Command Line runner type and enter your unity build command there.

Example

AliZaibVR commented 7 years ago

Hello @hex Thanks for the help and quick response. Things are lot clear to me.

I am trying command line arguments as you said. We are passing variables like build target, build path etc in command line. How do we access it in the executeMethod ? Because we need these values to pass in "BuildPipeline.BuildPlayer(levels, locationPathName,target)" function in executeMethod.

hex commented 7 years ago

@AliZaibVR You can pass params to executeMethod but I never used it myself. From Unity Documentation:

Execute the static method as soon as Unity is started, the project is open and after the optional Asset server update has been performed. This can be used to do tasks such as continous integration, performing Unit Tests, making builds or preparing data. To return an error from the command line process, either throw an exception which causes Unity to exit with return code 1, or call EditorApplication.Exit with a non-zero return code. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs. To use -executeMethod, you need to place the enclosing script in an Editor folder. The method to be executed must be defined as static.

I for example, use multiple methods for different scenarios. What is your case?

AliZaibVR commented 7 years ago

Oh. I missed it while reading it. I can access them using System.Environment.GetCommandLineArgs. My case is simple and same as yours. I am going to create multiple build configurations on teamcity that will run different executemethods and these executemethods will handle different scenarios. Thanks @hex for the help and quick response.