首页 > 解决方案 > 詹金斯文件 | 从 Jenkins 工作区上传文档到 Confluence

问题描述

我需要从 Jenkins 工作区上传文档以通过 Jenkinsfile 汇合。

我跟进了这个链接并开始编写基本代码,并确保这不起作用。任何人都可以添加或评论或建议我几个链接。

void Publish_Doc_Confluence(){
    withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'iam_user_jenkins']]) {
      publishConfluence attachArchivedArtifacts: true, pageName: '', replaceAttachments: true, siteName: '', spaceName: ''
    }
}

我也在使用 curl 命令上传文件,但徒劳无功-

命令-

    stage('Publish to Confluence') {
              steps {
              withCredentials([usernamePassword(credentialsId: 'confluence', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
              sh '''
            curl -D- -u $USERNAME:$PASSWORD -X PUT -H "X-Atlassian-Token: nocheck" -F "file=@code/pydoc/*.html" -F "minorEdit=false" 'https://alm-tuigroup.atlassian.net/wiki/rest/api/content/504955238/child/attachment'
'''
              }}}

我将在汇合页面中获得如下详细信息 -

标签: jenkins-pipelineconfluencejenkins-declarative-pipeline

解决方案


推荐阅读