Log changes in Jenkins

后端 未结 4 565
天涯浪人
天涯浪人 2021-01-15 12:09

Continuing on my question here: Jenkins pass or fail build on external executable

My build process now builds from source using MS Build, and executes a custom progr

4条回答
  •  心在旅途
    2021-01-15 12:28

    Me again :)

    On the simplest end of the spectrum, to simply add another link on the sidebar, along with "Changes" and "Status" links, there is a sidebar-link plugin
    https://wiki.jenkins-ci.org/display/JENKINS/Sidebar-Link+Plugin

    It allows you to create a link on the job page (not individual job runs however), which can link to a absolute or a relative (to job's configuration) location. You can reference a file within the workspace by putting the following into the link URL:

    ws/my_output.txt
    

    This however implies that the file is always present in workspace, and at best it would show the result of the last job execution. Also, clicking the link would take you to the file in workspace, it won't show the rest of the Jenkins UI anymore.

    A more advanced approach would be to use a Groovy Script
    https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin

    Look at examples #1 and #6
    enter image description here enter image description here

    The stuff next to yellow exclamation icon is what had been added to the job's status page by this plugin, and this is fully customizable and allows HTML code. This however requires knowing Groovy script, but the examples provide enough to do something quick

提交回复
热议问题