I need to upload html files from Jenkins workspace to confluence via CURL command.
Script used:-
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.
I followed below link but unable to crack it. https://developer.atlassian.com/cloud/confluence/rest/#api-content-get