0
votes

I want to change the build dir of team city build agent to:

E://MY_PROJECT_SVN

While installing the build agent I set the same but it diaplays C://buildAgent/work in TeamCity web ui due to which my build fails.

My buildAgent.properties file shows

workDir=E\:\\MY_PROJECT_SVN

And buildAgent.dist.properties file shows

workDir=E://MY_PROJECT_SVN

But I get following error when I run team city

Failed to start MSBuild.exe. Failed to find project file at path: C:\BuildAgent\work\3ac16e0b4e3af05b\Modules\SIM5.sln

Because of wrong working dir

3
What is the checkout directory declared in the target definition ?Biswajit_86
@Biswajit_86 What do you mean by target definition?adnan kamili

3 Answers

1
votes

The buildAgent.dist.properties is indeed just an example, but the solution is something you almost had; you need to put this into the buildAgent.properties:

workDir=E:/MY_PROJECT_SVN

Update:

It should be noted that on TeamCity 7.0 the workDir seemingly can't be on a separate disk; it runs most of the way through the build and then fails. However, using a junction to point from the local (default) folder to the E: drive will work. The tempDir can be pointed to a remote disk though.

0
votes

The file buildAgent.dist.properties is not used, it is just an example. So don't worry about the contents of that file.

What you have set in buildAgent.properties is what matters. What is happening for you is the agent is reverting to the default location for the working directory.

This means that for some reason it is not able to read or parse the buildAgent.properties file. Make 100% certain that the entire file has no errors in it.

https://confluence.jetbrains.com/display/TCD8/Build+Agent+Configuration

Making any change to this file and saving it should cause the build agent to reboot automatically and reload the new config once it has restarted.

http://blog.jetbrains.com/teamcity/2007/10/configuration-files-editing-without-teamcity-restart/

0
votes

To build on paul-f-wood's answer:

Teamcity 9.1.6 also has the "feature" where the work directory cannot be on a different drive. I tried several permutations of the temp and work dir, and the only ones that stuck were with the work dir on the same drive as the root teamcity folder. However as paul said, using a junction works like a charm.

cmd: rm C:\BuildAgent\work

cmd: mklink /J C:\BuildAgent\work E:\MY_PROJECT_SVN