Is there any environment variable for the current build directory?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there any environment variable for the current build directory?

Markus Neifer
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b349c91e-e290-4e4f-97a1-b4bcb1215b62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any environment variable for the current build directory?

Mark Waite-2


On Tuesday, March 6, 2018 at 2:12:18 AM UTC-7, Markus Neifer wrote:
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?


How about a Pipeline step https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-pwd-code-determine-current-directory ?

 
Thanks in advance.

Kind regards,
Markus

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cc8ea276-19a0-4529-81af-b970970d2552%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any environment variable for the current build directory?

Björn Pedersen
In reply to this post by Markus Neifer
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

Am Dienstag, 6. März 2018 10:12:18 UTC+1 schrieb Markus Neifer:
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4259a871-c9d1-435a-beb9-996e4c538ade%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.