Refresh environment variable for Build Agents without disconnection.

For example, if I want to update the environment variable for build agent. I need modify it on the agent like either through command  '[Environment]::SetEnvironmentVariable("Path", "newpath", [System.EnvironmentVariableTarget]::Machine)' , or add 'env.Path' in buildagent.properties file. 

The first methods will not get the environment variable update unless I restart the 'TeamCity Build Agent' service, the second methods will cause few seconds disconnection after modifying buildagent.properties file. These two methods will both lead to disconnection for a little bit while.

Is there a way to refresh the environment variable for build agent and will not cause disconnection. maybe like an api, call this api and it will let TC server refresh a certain build agent?

0
1 comment
Hi! Currently, there is no such feature in TeamCity. If having such an option is essential for you, could you explain your use case in more detail? The way I see it is it shouldn't take long to restart the agent if you need to change some environment variable value manually. And if the value is set automatically, the agent should have the correct value upon starting up.
0

Please sign in to leave a comment.