I have a pretty simple Jenkinsfile:
pipeline {
agent { docker 'node:6.10' }
environment {
NPM_CONFIG_USERCONFIG = 'T2/.npmrc'
}
stages {
stage('Packages') {
steps {
sh 'node -v'
*dir ('T2/bot') { *
* sh 'npm install'*
* }*
}
}
}
}
When I hit the *dir()* rule, I see the following in the logs:
[Pipeline] dir
Running in ...USFQ/T2/bot
[Pipeline] {
[Pipeline] sh
[T2bot] Running shell script
*JENKINS-33510: working directory will be ...USFQ not ..USFQ/T2/bot*
+ npm install
JENKINS-33510 <https://issues.jenkins-ci.org/browse/JENKINS-33510> says:
"dir('foo') inside 'docker.image().inside{}' does not affect CWD of
launched processes". My Jenkinsfile doesn't appear to have an
*image().inside* block (right?), yet *dir()* is failing in the same way.
Does *dir()* *ever* work, or am I doing something particularly strange?
Thanks in advance for any help!
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/91edac6b-b3a2-42f5-83d6-23d566eabc9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.