Jenkins: how to print the contents of a text file in the build log?

I have a Jenkins non-deterministically working build step that prints text. It is multi-line and contains many URLs. This is the python build step. print("""\ xxxx yyy ")

It works many times, but not all the time - it messes up the next step when it fails.

I'm not sure how to debug, but maybe I should just add a step that displays the contents of the text file in the console output log. I can't find such a plugin? thank!

+3


source to share


1 answer


If your Jenkins is running on Linux, a simple "Execute Shell" step cat filename.txt

will print the file to the console

If you start Windows, run "Execute Command Prompt" with type filename.txt

.



The file path refers to WORKSPACE

+3


source







All Articles