【问题标题】:Azure Jfrog Integration - Yaml pipeline limit number of searchesAzure Jfrog 集成 - Yaml 管道限制搜索次数
【发布时间】:2022-08-09 03:47:08
【问题描述】:

我想将我的搜索限制为只有 1 个最后更新的文件如何将其添加到我的代码中?我尝试在大括号方括号后添加limit(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

    标签: azure azure-devops yaml artifactory jfrog-cli


    【解决方案1】:

    根据this documentation limit 应该与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
        }
      ]
    }
    

    【讨论】:

      猜你喜欢
      • 2022-11-04
      • 2021-07-28
      • 1970-01-01
      • 2020-03-23
      • 2020-03-21
      • 2022-08-17
      • 2020-02-21
      • 1970-01-01
      • 2020-10-05
      相关资源
      最近更新 更多