我需要通过Jenkinsfile从Jenkins工作区上载文档到汇合处。
我跟踪了此链接,并开始编写基本代码,并确保这将不起作用。任何人都可以添加或评论或建议我几个链接吗?
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'
'''
}}}
在融合页面中,我将从何处确切地获得如下所示的详细信息-