使用jenkins融合显示sh脚本输出

时间:2018-12-01 17:19:34

标签: jenkins jenkins-plugins jenkins-pipeline confluence confluence-rest-api

我想使用jenkins发布confluence中的bash脚本的输出,并且每次confluence中打开的页面都会更新输出。有可能这样做吗?

1 个答案:

答案 0 :(得分:0)

您可以使用Confluence Rest Api。

您可以尝试此https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/

示例:

curl -u jira_username_login:jira_password -X POST -H 'Content-Type: application/json' -d '{"type":"page","title":"new page",
"space":{"key":"TST"},"body":{"storage":{"value":"<p>This is <br/> a new page</p>","representation":
"storage"}}}' http://localhost:8080/confluence/rest/api/content/ | python -mjson.tool

要获取bash输出,请执行以下操作: How to set a variable to the output of a command in Bash?