I have searched over the internet and could not find any option to write the job's console output to a file in workspace. Could you someone please help me out?
Asked
Active
Viewed 3,019 times
1 Answers
1
You can add a groovy system script or groovy post build step to gain access to the console output using manager.build.logFile.text
(if post build groovy) or build.logFile.text
if groovy system script.
Once you have that, you can write out the string to a file using either the standard File function (if everything is running on Jenkins master) or FilePath (if the job is running on a remote slave).
Please see this answer for an explanation of the FilePath class.

Community
- 1
- 1

Daniel Omoto
- 2,431
- 17
- 15