【问题标题】:Jfrog artifactory cliJfrog 神器cli
【发布时间】:2018-09-03 12:35:50
【问题描述】:

您我正在尝试在文件规范中传递两个 ${key} 值。有什么方法可以通过 jfrog cli 命令调用这两个 ${key} 值吗?

例如,我尝试了以下命令

sh "./jfrog rt s --spec compare.spec  --spec-vars currentBuild=${currentBuild.number};previousBuild=${currentBuild.previousBuild.number}"

但它只显示一个值的输出。

【问题讨论】:

    标签: jfrog-cli


    【解决方案1】:

    该命令缺少围绕规范变量的引号。因此,例如使用像

    这样的规范文件
    {
        "files": [
            {
                "pattern": "${pat}/",
                "target": "${tgt}/"
            }
        ]
    }
    

    我需要运行命令

    jfrog rt dl --spec otherspec --spec-vars "pat=generic-local;tgt=local"
    

    为了确保我将文件从“通用本地”存储库下载到名为“本地”的文件夹中

    如果您使用JFROG_CLI_LOG_LEVEL=DEBUG 执行命令,输出将显示您提供的规范文件以及解析的文件:

    $ JFROG_CLI_LOG_LEVEL=DEBUG jfrog rt dl --spec otherspec --spec-vars "pat=generic-local;tgt=local"
    [Debug] Replacing variables in the provided File Spec:
    {
        "files": [
            {
                "pattern": "${pat}/",
                "target": "${tgt}/"
            }
        ]
    }
    [Debug] Replacing '${pat}' with 'generic-local'
    [Debug] Replacing '${tgt}' with 'local'
    [Debug] The reformatted File Spec is:
    {
        "files": [
            {
                "pattern": "generic-local/",
                "target": "local/"
            }
        ]
    }
    [Info] Searching items to download...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-03
      • 2020-01-08
      • 1970-01-01
      • 2022-11-04
      • 1970-01-01
      • 2016-01-10
      • 2017-01-22
      • 1970-01-01
      相关资源
      最近更新 更多