Zum abrufen des aktuellen Arbeitsbereichs über Jenkins Pipeline Groovy-Skript?

Ich versuche, Holen Sie sich die aktuellen Arbeitsbereich meiner Jenkins-build mit groovigem pipeline-Skript:

node('master') {
    //PULL IN ENVIRONMENT VARIABLES
    //Jenkins makes these variables available for each job it runs
    def buildNumber = env.BUILD_NUMBER
    def workspace = env.WORKSPACE
    def buildUrl = env.BUILD_URL

    //PRINT ENVIRONMENT TO JOB
    echo "workspace directory is ${workspace}"
    echo "build URL is ${env.BUILD_URL}"
}

Gibt es:

[Pipeline] Allocate node : Start
Running on master in /Users/Shared/Jenkins/Home/jobs/test/workspace
[Pipeline] node {
[Pipeline] echo
workspace directory is null
[Pipeline] echo
build URL is http://localhost:8080/job/test/5/
[Pipeline] } //node
[Pipeline] Allocate node : End
[Pipeline] End of Pipeline
Finished: SUCCESS
InformationsquelleAutor N.Reddy | 2016-06-15
Schreibe einen Kommentar