I'm trying to set up TeamCity to build my project, but my psake buildscript fails, with the reason being narrowed down to its inability to find the git executable, which is supposed to be on the path. When I start a PowerShell and execute the thing by myself, everything works fine.
The content of the Path environment variable (as shown in the System variables list in the windows Environment Variables dialog, as well as the registry at HKEY_LOCAL_MACHINESYSTEMControlSet001ControlSession ManagerEnvironmentPath
) is
%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;c:Program Files (x86)Microsoft SQL Server90Toolsinn;c:Program Files (x86)Microsoft SQL Server100ToolsBinn;c:Program FilesMicrosoft SQL Server100ToolsBinn;c:Program FilesMicrosoft SQL Server100DTSBinn;c:Program Files (x86)Microsoft SQL Server100ToolsBinnVSShellCommon7IDE;c:Program Files (x86)Microsoft SQL Server100DTSBinn;C:Program Files (x86)Gitcmd
yet TeamCity says its env.Path is just
C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;c:Program Files (x86)Microsoft SQL Server90Toolsinn;C:WindowsSystem32WindowsPowerShellv1.0
I have restarted the computer (multiple times) which does not help whatsoever.
Why is the TeamCity build agent's PATH variable different from the system default, and how can I fix it?
question from:
https://stackoverflow.com/questions/8827696/where-does-a-teamcity-build-agent-get-its-path-environment-from 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…