Is there any environment variable for the current build directory?

20 views
Skip to first unread message

Markus Neifer

unread,
Mar 6, 2018, 4:12:18 AM3/6/18
to Jenkins Users
Hi all, I want to process the JUnit result file junitResult.xml for the current build. I have found this file in path $JENKINS_HOME/jobs/<project>/branches/<branch>/builds/<buildNumber>/junitResult.xml . Now I want to use the current path in my Jenkins file as parameter like this

        stage ("Process test result") {
            sh "mytool -resultFile ${env.<pathToJunitResultXml>}"
        }

I've tried env.WORKSPACE, but this is the checkout directory. Is there any environment variable for the current build directory?

Thanks in advance.

Kind regards,
Markus

Mark Waite

unread,
Mar 6, 2018, 1:48:51 PM3/6/18
to Jenkins Users

Björn Pedersen

unread,
Mar 7, 2018, 2:40:49 AM3/7/18
to Jenkins Users
Hi,

how does the file end up there in the first place? I guess that is copied there by the junit publisher (or by archiveArtifacts?), the original file should still be in the workspace.

Björn
Reply all
Reply to author
Forward
0 new messages