【问题标题】:CURL | Upload multiple html files to confluence卷曲 |上传多个 html 文件到 confluence
【发布时间】:2018-12-19 22:46:36
【问题描述】:

我需要通过 CURL 命令从 Jenkins 工作区上传 html 文件到 confluence。

使用的脚本:-

stage('Publish to Confluence') {
          steps {
          withCredentials([usernamePassword(credentialsId: 'confluence', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
          sh '''
          curl -v -S -u $USERNAME:$PASSWORD -X POST -H "X-Atlassian-Token: no-check" -F "file_0=@code/pydoc/manage_connections.html" "https://alm-group.atlassian.net/wiki/spaces/PROJECT/pages/830833705/PyDoc"
          '''
          }}}

问题是-它正在将单个文件作为附件上传。我需要上传一堆文件,但我做不到。

我点击了下面的链接,但无法破解它。 https://developer.atlassian.com/cloud/confluence/rest/#api-content-get

【问题讨论】:

    标签: curl confluence confluence-rest-api


    【解决方案1】:

    我认为这根本不是 Jenkins 的问题。

    这实际上是this one的副本。

    对于许多文件,只需将 -F 与 @ 重复。

    curl -F "image=@file1.gif" -F "image2=@file2.gif"  http://localhost:8888/web/Upload.php
    

    【讨论】:

      猜你喜欢
      • 2011-06-07
      • 2020-04-24
      • 2013-02-19
      • 2012-06-21
      • 2013-03-21
      • 2017-11-16
      • 2017-07-14
      • 2017-08-09
      • 1970-01-01
      相关资源
      最近更新 更多