I was wondering if there is a way to connect GitLab with Confluence. I want to update Confluence-Pages with a pipeline every time something is being pushed into a Gitlab-Project.
You either need to use Add-ons from Atlassian Marketplace or use Confluence REST API to develop your own script.
Add-ons which is available in Marketplace will work out of the box but of course you don't have flexibility to change them. Your own script has an advantage of flexibility.
Depends on what you want to achieve it might have different approach but base on what you mentioned, if you want to update an existing page, you can call Confluence REST API for update existing page and do the changes that you want. For example following update an existing page in Confluence:
curl -u admin:admin -X PUT -H 'Content-Type: application/json' -d'{"id":"3604482","type":"page",
"title":"new page","space":{"key":"TST"},"body":{"storage":{"value":
"<p>This is the updated text for the new page</p>","representation":"storage"}},
"version":{"number":2}}' http://localhost:8080/confluence/rest/api/content/3604482 | python -mjso
Take a look at Atlassian Marketplace for the add-ons and also Confluence REST API Examples for further details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With