如何跳过具体的执行计划步骤?

时间:2017-04-26 12:28:15

标签: deployit xl-deploy

TaskBlockService中,有一个POST来电 that one or more steps should be skipped 。鉴于发布的XML(字符串列表)如何跳过步骤的路径,没有一个很好的例子。

尝试了POSTed数据的以下内容:

curl  -X POST  https://xldeploy.company.com/deployit/tasks/v2/5e917094-d054-4cc7-940e-89d851ca225a/skip

档案remove-steps.xml内容 - 样本1:

<list>
    <string>0_1_1</string>
</list>

档案remove-steps.xml内容 - 样本2:

<list>
    <string>0-1-1</string>
</list>

1 个答案:

答案 0 :(得分:1)

您列出的第一种格式是正确的,但您必须确保使用的是步进路径,而不仅仅是块的路径。

假设您通过此调用从部署计划中获取了块。

curl -uadmin:password http://localhost:4516/deployit/tasks/v2/28830810-5104-4ab9-9826-22f66dee265d

这将产生结果:

<task id="28830810-5104-4ab9-9826-22f66dee265d" failures="0" state="PENDING" owner="admin">
  <description>Initial deployment of Environments/local/TestApp001</description>
  <activeBlocks/>
  <metadata>
    <environment>local</environment>
    <taskType>INITIAL</taskType>
    <environment_id>Environments/local</environment_id>
    <application>TestApp001</application>
    <version>1.0</version>
  </metadata>
  <block id="0" state="PENDING" description="" root="true">
    <block id="0_1" state="PENDING" description="Deploy" phase="true">
      <block id="0_1_1" state="PENDING" description="Deploy TestApp001 1.0 on environment local"/>
    </block>
  </block>
  <dependencies/>

如果要查看块0_1_1中的步骤,则可以使用此休息调用来获取步骤。

curl -uadmin:password http://local6/deployit/tasks/v2/28830810-5104-4ab9-9826-22f66dee265d/block/0_1_1/step

<block id="0_1_1" state="PENDING" description="Deploy TestApp001 1.0 on environment local" current="0">
  <step failures="0" state="PENDING" description="Execute Command"/>
  <step failures="0" state="PENDING" description="Copy File001.txt to Infrastructure/localhost"/>

步骤在从1开始的块中编号。因此,如果您想跳过步骤 - 将File001.txt复制到Infrastructure / localhost,则步骤路径为0_1_1_2。您的XML将如下所示:

<list>
    <string>0_1_1_2</string>
</list>