Issue
I have some regression tests running on jenkins. Each testcase produces a nosetests.xml that is used to get the junitResult.xml (is found on the jenkins home directory).
I want to copy/save the junitResult.xml(on jenkins home directory) to the slave workspace using pipeline.
How can I do this?
Edit My team has removed any access to the master. It seems however that the junitResult.xml file is found in the home directory. Is it possible to save this file elsewhere?
Solution
You can use the stash and unstash pipeline keywords to achieve what you want.
The stash
keyword saves a set of files for later use on any node/workspace in the same Pipeline run, and the unstash
restores a set of files previously stashed into the current workspace.
In your case, on the master you can stash the junitResult.xml
file and later on unstash it to the workspace of the agent you want.
Answered By - Noam Helmer
Answer Checked By - Mary Flores (JavaFixing Volunteer)