how to publish Jenkins build to confluence

senai.teklemichael
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 21, 2020

So I'm working in a situation where we are conducting frequent performance tests using Jenkins and Gatling. When a particular jenkins job is done running, it produces a log with an attached Gatling report. What i would like to do is generate a confluence page in a predefined space that contains:

  • date of the test 
  • the jenkins parameters used to run the Job
  • link to the jenkins job
  • link to the gatling report
  • and if possible a snippet of the jenkins log (not the whole thing but just a selected part)

I have looked at several option but none seem to provide the specificity i'm looking for.

1 answer

0 votes
Ganesh Gautam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2021

Hi Senai,

 

Thanks so much for your question.

It looks like you are trying to use an artefact from a Jenkins build (happens to be html) and push it to Confluence page.

You can choose to use Confluence REST API(bash/ruby/nodejs) and add a task to your Jenkins pipeline. Confluence supports REST endpoints for creating a new page and uploading new attachments to a page. Please follow this Rest API guide to upload the html created in previous task. 

Pro-tip: Instead of basic auth, you can choose to use Personal Access token in your script to do so in Confluence 7.10 and above.

Thank you,

Ganesh Gautam

Confluence Data Center team

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events