Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
329 views
in Technique[技术] by (71.8m points)

continuous integration - Where does a TeamCity build agent get its path environment from?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I ran into this same issue and only needed to restart the Team City Build Agent Service to pick up changes to the PATH variable.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...