CURL |上传多个html文件以融合 [英] CURL | Upload multiple html files to confluence

查看:127
本文介绍了CURL |上传多个html文件以融合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过CURL命令将Jenkins工作区中的html文件上传到融合处。

I need to upload html files from Jenkins workspace to confluence via CURL command.

使用的脚本:-

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"
          '''
          }}}

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

Issue is- It is uploading single file as a attachment. I need to upload bunch of files but I am not able to do it.

我关注了以下链接,但无法破解。
https://developer.atlassian.com/cloud / confluence / rest /#api-content-get

I followed below link but unable to crack it. https://developer.atlassian.com/cloud/confluence/rest/#api-content-get

推荐答案

我认为这根本不是詹金斯问题。

I think it's not a Jenkins question at all.

这实际上是

This is actually a duplicate of this one.

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

For many files just duplicated the -F with @.

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

这篇关于CURL |上传多个html文件以融合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆