0.teamcity内置的有用的变量
“%system.teamcity.buildType.id%”
“%system.teamcity.projectName%”
“%teamcity.build.triggeredBy%”
“%system.teamcity.buildConfName%”
“%system.teamcity.configuration.properties.file%”
“**********************”
“%teamcity.agent.name%”
“%teamcity.agent.work.dir%”
“%teamcity.agent.work.dir.freeSpaceMb%”
“%teamcity.agent.home.dir%”
“%teamcity.agent.tools.dir%”
“%teamcity.agent.jvm.os.version%”
“%teamcity.agent.os.arch.bits%”
“%DotNetFramework4.8_x64%”
“%DotNetFramework4.8_x64_Path%”
“%teamcity.build.checkoutDir%”
“%teamcity.build.workingDir%”
“%system.teamcity.build.tempDir%”
“%system.teamcity.build.properties.file%”
1.关闭/打开特定build的trigger
#用curl关闭build名为aa,trigger的id为TRIGGER_107的trigger。
#-d "false",则是打开相应trigger
#http://\<TeamCity Server host>:\<port>/app/rest/buildTypes/name:aa/triggers 可以查看aa这个build的所有trigger
#apiKey是user token,需要先行定义
apiKey="xxxxx"
curl -H "Authorization: Bearer ${
apiKey}" \
-H "Content-Type:text/plain" \
-X PUT \
-d 'true' \
"http://\<TeamCity Server host>:\<port>/app/rest/buildTypes/name:aa/triggers/TRIGGER_107/disabled"
#使用Invoke-RestMethod实现相同功能
$apiKey = "xxxxx