【问题标题】:teamcity rest api to get the number of builds generating artifactsteamcity rest api 获取生成工件的构建数量
【发布时间】:2019-06-18 16:50:16
【问题描述】:

我想知道如何找到在常规设置页面的工件路径部分中定义了工件的 teamcity 构建

我试过这个Teamcity REST API: get an artifact path,但它没有回答我的问题

我想获取每月生成一些工件(基本上是在常规设置页面的工件路径部分中定义的工件)的 teamcity 构建的计数。例如,在 5 月份触发了多少这样的构建。

【问题讨论】:

    标签: rest api teamcity artifacts


    【解决方案1】:

    您可以获取构建列表,例如/app/rest/builds/?locator=buildType:<conf id>,提取 id 并获取此构建的工件

    /app/rest/builds/id:<buildID>/artifacts/children/

    <files count="1">
    <file name="result.zip" size="73785398" modificationTime="20190617T162953+0000" href="/app/rest/builds/id:45771/artifacts/metadata/result.zip">
    <content href="/app/rest/builds/id:45771/artifacts/content/result.zip"/>
    </file>
    </files>
    

    如你所见,我把所有文件都收集到了result.zip,我们把这个ZIP解压出来看看里面有什么

    /app/rest/builds/id:&lt;buildID&gt;/artifacts/children/result.zip/

    <files count="2">
    <file name="bin" modificationTime="19700101T000000+0000" href="/app/rest/builds/id:45771/artifacts/metadata/result.zip%21/bin">
    <children href="/app/rest/builds/id:45771/artifacts/children/result.zip%21/bin"/>
    </file>
    <file name="yaml" modificationTime="19700101T000000+0000" href="/app/rest/builds/id:45771/artifacts/metadata/result.zip%21/yaml">
    <children href="/app/rest/builds/id:45771/artifacts/children/result.zip%21/yaml"/>
    </file>
    </files>
    

    因此,您可以按状态收集上个月的特定版本。
    您可以为每个构建收集工件 pats。
    您可以根据需要汇总所有结果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-15
      • 1970-01-01
      • 2013-09-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多