【问题标题】:How to automate release and staging phases with token using Jenkins and Artifactory?如何使用 Jenkins 和 Artifactory 使用令牌自动化发布和暂存阶段?
【发布时间】:2017-10-10 12:52:53
【问题描述】:

我想在 jenkins 作业中自动化 Artifactory 发布和登台。

我得到了这个 curl 命令,

curl -X GET "http://localhost:9090/job/artifactory-8.0-release/artifactory/staging?

它工作正常,但它要求进行身份验证。当我进行自动化时,我只需要使用令牌而不是用户凭据来调用它。

请帮忙。

【问题讨论】:

    标签: jenkins continuous-integration jenkins-pipeline artifactory jenkins-api


    【解决方案1】:

    有几种方法可以使用令牌进行身份验证。

    基本身份验证

    curl -u<USERNAME>:<TOKEN> http://ARTIFACTORY_URL/api/system/ping
    

    授权标头

    curl -H"Authorization: Bearer <TOKEN>" http://ARTIFACTORY_URL/api/system/ping
    

    来源:JFrog Artifactory 文档页面'Access Tokens'

    【讨论】:

      猜你喜欢
      • 2014-04-22
      • 2014-03-04
      • 2016-11-02
      • 1970-01-01
      • 2016-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多