Search code examples
batch-fileteamcitybuild-agent

How to change the build agent work location to other location from teamcity server


I invoked the bat from teamcity server. Below is the log. In the bat which has to change directory location to what I have mentioned in the cd.

Starting:C:\AUTOEBCDeployment\Autodeploy.bat
in directory: D:\ProgramData\JetBrains\TeamCity BuildAgent\work\8a77def6c3e16d10
D:\ProgramData\JetBrains\TeamCity BuildAgent\work\8a77def6c3e16d10>cd C:\AUTOEBCDeployment\dist
D:\ProgramData\JetBrains\TeamCity BuildAgent\work\8a77def6c3e16d10>for /F "tokens=*" %a in ('dir /b /a-d *.zip') do set DIST_FILE=%a 
File Not Found

Solution

  • you can set "Working directory" in your build step

    enter image description here

    Or you can change the agent property. Open buildagent.property file and change the parameter workDir=C:\AUTOEBCDeployment\dist