1

I have a Maven project which performs a number of time consuming tests as part of the integration-test Maven cycle. I'm using Jenkins as the CI server.

During the integration test a number of files are produced in the target folder. For example, an "actual" BMP file is produced and compared to an "expected" BMP file. If the test fails, I need to look at the files in the target folder to determine how to deal with the error. Maybe the actual BMP looks fine and so it should be promoted to the new expected BMP. On the other hand, it may reveal a problem that requires a code fix.

The thing is I don't have any way to get access to these files, other than to ssh into the CI server and manually scp the files over to my own machine for closer inspection. It would be extremely helpful if I could access these files from the Jenkins web interface.

I tried using the build-helper-maven-plugin to attach the relevant files as Maven artifacts, but the problem is that there is no suitable phase in Maven that executes after an integration-test, if any test fails.

What can I do? Can I use the "Copy Artifact" plugin for this?

user1283068
  • 1,694
  • 4
  • 15
  • 25
  • 1
    have you tried to access the workspace via Jenkins UI ? – khmarbaise Mar 21 '12 at 11:55
  • As @khmarbaise says, as long as you don't delete your workspace at the end of your build job you should be able to get to your files via http:///job//ws/ – gareth_bowles Mar 21 '12 at 18:15
  • Yes exactly. But the question is: Do you need those artifacts just for controlling purposes or would you like to use them for other things? – khmarbaise Mar 22 '12 at 08:17
  • I am able to access the relevant files from the jenkins UI. It didn't occur to me that it was that simple .. :-) – user1283068 Mar 23 '12 at 08:29
  • Follow up question: Is it possible to add a static link to Jenkins' left menu or some other place, so that you don't have to navigate into the workspace, find the right project and module, find the target folder ... etc? – user1283068 Mar 23 '12 at 08:29
  • Answering my own question, the sidebar plugin can do that easily. I guess this resolves my problem. – user1283068 Mar 28 '12 at 08:08

2 Answers2

2

1) The files in the target folder can be accessed using a link such as /ws/projectname/target/filename...

2) Rather than typing the url each time, the SideBar plugin can be used to add a link to the file to Jenkins' left menu, making it easily accessible.

user1283068
  • 1,694
  • 4
  • 15
  • 25
0

You need to copy your files into your workspace in a build step and archive them from there - Jenkins lets you specify artifacts only relative to the workspace.

I usually create a directory keyed by the BUILD_ID in the workspace, so that artifacts from different builds do not get mixed up in case I do not clean the workspace and archive from there (specifying ${BUILD_ID}/**/* in the archiving step).

In case your build fails before it can run the copying step and because of it does not do the copy, take a look at this question.

Community
  • 1
  • 1
malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87