Horst Krause
Horst Krause

Reputation: 686

Jenkins: How to show last build (not only last successful build) artifacts on job main page?

By default jenkins shows the "last successful artifacts" on the jobs main page. This is ok most of the time. And I know how to configure the jobs to also store the artifacts in case of build failure.

But: In case of build failure the link to the artifacts of the failed build is only displayed as "build artifacts" on the build page of the job - not on the main page of the job. On the main page of the job there are still linked the "last successful artifacts" which come from an older build.

So what quite often happens: The developer gets the failure mail from jenkins, opens the job in jenkins and sees the jobs main page with the older successful artifacts. Because he does not realize this, he opens e.g. the dependency-check report to take a look at the error details - and wonders why there are no errors. This is sometimes quite confusing. The job reports an error, but the developer cannot see it - just because he opened the relevant artifact not from the failed build but from the last successful build.

So to make a long story short: How can I change the jobs main page to show not only the last successful artifacts but also always the artifacts of the last build - even if this was not successful. It should be the same link as on the jobs build page.

Upvotes: 1

Views: 3476

Answers (1)

Arun Kumar B
Arun Kumar B

Reputation: 311

You can use Sidebar Link to add any link to the job's main page.

Provide the URL of the last build's artifacts, an appropriate name and image:
URL - http://JENKINS_SERVER_IP:8080/job/JOB_NAME/lastBuild/artifact
Text - Last Build Artifacts
Icon - /images/24x24/package.png

enter image description here

Upvotes: 0

Related Questions