-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
v3.11.394
The minimal Pipeline script results in an error:
java.nio.file.NoSuchFileException: /var/lib/jenkins/jobs/.../.../workspace
pipeline { agent any stages { stage('Read file') { steps { script { readFile("${WORKSPACE}") } } } } }
Total unclear to me because readFile should be the method to read a file on the slave where new File("${WORKSPACE}") will allways read it on the master. Any hint?
With that code it was working, but the documentation tells me to do it not like this:
pipeline {
agent any stages {
stage('Read file') {
steps {
script {
openshift.withCluster() {
openshift.withProject("my-project") {
new File("${WORKSPACE}")
}
}
}
}
}
}
}