Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store jenkins build output with artifacts?

Tags:

jenkins

I have a Jenkins (which I'm new to) system that has a few constraints imposed on it:

  • master/slave arrangement
  • slave is Windows 7
  • installing plugins is likely to experience significant resistance
  • builds are to be archived to a Windows share

The goal is to have the output of the build and the log of the build archived to:

//server/share/archive/%BUILD_TAG%/

I'm using the post-build step Send build artifacts to a windows share to push the binaries to the archiving server, but I've yet to find a way to arrange for the build log to end up there too. I have discovered that the console output is available at http://jenkins/job/$jobTitle/$buildNumber/consoleText, but I'm not sure how useful that is going to be - I can't cause anything to run on the archive server to run. I'd like to maintain the separation that the master Jenkins knows about the slave and the archive, but the slave and archive are unaware of each other (that's assuming the Send build artifacts... step is running on the master rather than being pushed down to the slave to action).

Another approach I explored was to have Jenkins store the artifacts locally (via Archive the artifacts), but then I don't see a way to promtply push the result + log to the external server.

It seems that Jenkins is very flexible and that this scenario is likely already catered for, but I've yet to find out how.

like image 453
Chris Avatar asked Oct 31 '22 00:10

Chris


1 Answers

Using the Post Build Task plugin, you can get the console output with a wget command:

wget -O console-output.log ${BUILD_URL}consoleText
like image 89
Bruno Lavit Avatar answered Nov 15 '22 06:11

Bruno Lavit