Azure Jfrog集成 - YAML管道限制搜索数量

发布于 2025-02-13 05:23:45 字数 1171 浏览 1 评论 0原文

我想将搜索仅限为最后一个更新的文件,如何将其添加到我的代码中?我试图在卷发后添加限制(1)方形支架,但它不起作用。有人知道如何将其应用于我的代码吗?

ArtifactoryGenericDownload@3
    inputs:
      connection: "JFROG"
      specSource: "taskConfiguration"
      fileSpec: |
        {
            "files": [
                {
                    "target": "./$(Pipeline.Workspace)/de-cf-dnalib",
                    "aql": {
                        "items.find":{
                            "repo":"python",
                            "$and":[
                                {
                                    "$and": [
                                        { "name": { "$match": "*.whl" } },
                                        { "modified": { "$last": "10d" } }
                                    ]
                                },
                                {
                                    "$and": [
                                        { "name": { "$nmatch": "*dev*" } }
                                    ]
                                }
                            ]
                        }
                    }
                }
            ]
        }
      failNoOp: true

I want to limit my search to only 1 last updated file how can I add this to my code ? I tried to add limit(1) after curly, square bracket but it didn't work. Does anyone know how to apply this to my code ?

ArtifactoryGenericDownload@3
    inputs:
      connection: "JFROG"
      specSource: "taskConfiguration"
      fileSpec: |
        {
            "files": [
                {
                    "target": "./$(Pipeline.Workspace)/de-cf-dnalib",
                    "aql": {
                        "items.find":{
                            "repo":"python",
                            "$and":[
                                {
                                    "$and": [
                                        { "name": { "$match": "*.whl" } },
                                        { "modified": { "$last": "10d" } }
                                    ]
                                },
                                {
                                    "$and": [
                                        { "name": { "$nmatch": "*dev*" } }
                                    ]
                                }
                            ]
                        }
                    }
                }
            ]
        }
      failNoOp: true

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

披肩女神 2025-02-20 05:23:52

此文档应与aql字段相邻。你能尝试一下吗?

{
  "files": [
    {
      "target": "./$(Pipeline.Workspace)/de-cf-dnalib",
      "aql": {
        "items.find": {
          "repo": "python",
          "$and": [
            {
              "$and": [
                {
                  "name": {
                    "$match": "*.whl"
                  }
                },
                {
                  "modified": {
                    "$last": "10d"
                  }
                }
              ]
            },
            {
              "$and": [
                {
                  "name": {
                    "$nmatch": "*dev*"
                  }
                }
              ]
            }
          ]
        }
      },
      "limit": 1
    }
  ]
}

As per this documentation limit should be adjacent to aql field. Can you try this?

{
  "files": [
    {
      "target": "./$(Pipeline.Workspace)/de-cf-dnalib",
      "aql": {
        "items.find": {
          "repo": "python",
          "$and": [
            {
              "$and": [
                {
                  "name": {
                    "$match": "*.whl"
                  }
                },
                {
                  "modified": {
                    "$last": "10d"
                  }
                }
              ]
            },
            {
              "$and": [
                {
                  "name": {
                    "$nmatch": "*dev*"
                  }
                }
              ]
            }
          ]
        }
      },
      "limit": 1
    }
  ]
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文