具有多个跑步者的 Teamcity 元跑步者 - 在不失败构建的情况下退出跑步者
Teamcity meta-runner with multiple runners - exiting a runner without failing the build
好的,这是一个 TeamCity 元跑步者,里面有 2 个独立的跑步者。本质上,第一个运行者将有一堆逻辑来确定是否应该进行部署。
<build-runners>
<runner name="Step 1" type="jetbrains_powershell">
<parameters>
<param name="jetbrains_powershell_bitness" value="x86" />
<param name="jetbrains_powershell_execution" value="PS1" />
<param name="jetbrains_powershell_minVersion" value="4.0" />
<param name="jetbrains_powershell_script_code"><![CDATA[
#Bunch of powershell logic here... under some conditions we want nothing deployed
#Now I want to exit the whole build step, not just this single runner
Exit #<- Fails the whole build, not what I want
]"]]></param>
<param name="jetbrains_powershell_script_mode" value="CODE" />
<param name="teamcity.step.mode" value="default" />
</parameters>
</runner>
<runner name="Deploy Project" type="octopus.deploy.release">
<parameters>
<param name="octopus_additionalcommandlinearguments" value="" />
<param name="octopus_deployto" value="%Octopus.EnvironmentName%" />
<param name="octopus_host" value="%system.Octopus-ServerUrl%" />
<param name="octopus_project_name" value="%ProjectName%" />
<param name="octopus_releasenumber" value="%ProjectRelease%" />
<param name="octopus_version" value="3.0+" />
<param name="octopus_waitfordeployments" value="true" />
<param name="secure:octopus_apikey" value="123123" />
<param name="teamcity.step.mode" value="default" />
</parameters>
</runner>
</build-runners>
有什么方法可以退出整个 meta-runner 步骤,以便在下一个构建步骤中继续正常运行?
供应商的回应:
"It seems there is no clean way to skip remaining meta-runner steps without affecting build (successful) status. If you do not mind settings build to failed, you can try Execute "如果前面的所有步骤都成功完成”在要跳过的 meta-runner 步骤中。”
虽然 TeamCity 中的 meta-runner 功能非常好,但它也有其局限性。
好的,这是一个 TeamCity 元跑步者,里面有 2 个独立的跑步者。本质上,第一个运行者将有一堆逻辑来确定是否应该进行部署。
<build-runners>
<runner name="Step 1" type="jetbrains_powershell">
<parameters>
<param name="jetbrains_powershell_bitness" value="x86" />
<param name="jetbrains_powershell_execution" value="PS1" />
<param name="jetbrains_powershell_minVersion" value="4.0" />
<param name="jetbrains_powershell_script_code"><![CDATA[
#Bunch of powershell logic here... under some conditions we want nothing deployed
#Now I want to exit the whole build step, not just this single runner
Exit #<- Fails the whole build, not what I want
]"]]></param>
<param name="jetbrains_powershell_script_mode" value="CODE" />
<param name="teamcity.step.mode" value="default" />
</parameters>
</runner>
<runner name="Deploy Project" type="octopus.deploy.release">
<parameters>
<param name="octopus_additionalcommandlinearguments" value="" />
<param name="octopus_deployto" value="%Octopus.EnvironmentName%" />
<param name="octopus_host" value="%system.Octopus-ServerUrl%" />
<param name="octopus_project_name" value="%ProjectName%" />
<param name="octopus_releasenumber" value="%ProjectRelease%" />
<param name="octopus_version" value="3.0+" />
<param name="octopus_waitfordeployments" value="true" />
<param name="secure:octopus_apikey" value="123123" />
<param name="teamcity.step.mode" value="default" />
</parameters>
</runner>
</build-runners>
有什么方法可以退出整个 meta-runner 步骤,以便在下一个构建步骤中继续正常运行?
供应商的回应:
"It seems there is no clean way to skip remaining meta-runner steps without affecting build (successful) status. If you do not mind settings build to failed, you can try Execute "如果前面的所有步骤都成功完成”在要跳过的 meta-runner 步骤中。”
虽然 TeamCity 中的 meta-runner 功能非常好,但它也有其局限性。