Accessing TeamCity Agent system properties in a shell script

筅森魡賤 提交于 2019-12-11 05:37:33

问题


I have a requirement where I need to write a shell script to stop teamcity agents on a server(3 agents per linux server). I need to get the system property; agent.name OR configuration parameter teamcity.agent.name in a shell script OR All the agents running on a linux agent, via script or API


回答1:


Build parameters can be accessed from any build script. This is from TeamCity documentation:

Any user-defined build parameter (system property or environment variable) can reference other parameters by using the following format:

%[env|system].property_name% For example: system.tomcat.libs=%env.CATALINA_HOME%/lib/*.jar

If you need to access build properties outside the build step, it may be done by reading the content of file which name is stored in TEAMCITY_BUILD_PROPERTIES_FILE environment variable.

For more details:

https://confluence.jetbrains.com/plugins/servlet/mobile#content/view/74847308



来源:https://stackoverflow.com/questions/46238738/accessing-teamcity-agent-system-properties-in-a-shell-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!