Adding text to the page of a build triggered by th

2019-07-16 03:44发布

I have a Jenkins build system up and running for a project. The build is triggered via the remote API functionality of Jenkins. When a commit is made to the project we send an HTTP request build trigger to the Jenkins process running on our local server; with a parameter that specifies the revision of the trunk project folder in the SVN repository that we want to checkout and build.

We also send the SVN username and commit message for the revision as an additional http parameter. So the URL looks like:

http://server:8080/job/ProjectName/buildWithParameters?description=[commit message]&REVISION=[revision number]

I would like to display this description parameter somewhere on the build page but I've found no obvious method of doing this via build triggering from the remote API.

Do I need to name the parameter something specific or is a plugin required for this functionality?

2条回答
来,给爷笑一个
2楼-- · 2019-07-16 04:14
Anthone
3楼-- · 2019-07-16 04:19

One way to add a description is to add a Build Description. Jenkins displays a short text description under each build in the list of builds on the left of a project page.

You could use the Description Setter plugin to set the build description from within your build.

Or you can set the Build Description with a POST to http://server:8080/job/ProjectName/latestBuild/submitDescription with the POST data: description="YOUR_DESCRIPTION_HERE". The latestBuild token can be replaced with a specific build number if you have it.

查看更多
登录 后发表回答