-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: docker-workflow-plugin
-
Environment:Jenkins ver. 2.60.3
pipeline 2.5
Pipeline: Basic Steps 2.6
-
docker-workflow 1.19
It's said here, https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-dir-code-change-current-directory
Change current directory. Any step inside the dir block will use this directory as current and any relative path will use it as base path.
However, I can't seem to get it work. I use declarative syntax with a very basic Jenkinsfile
Â
pipeline {
agent none
stages {
stage('Change working directory...') {
agent { docker 'my-image' }
steps {
dir('new-dir') {
sh 'pwd'
}
}
}
}
}
What it does is simply create a new folder called "new-dir" in the current working directory and then the pwd prints out the current working directory instead of navigating into the "new-dir".
Am I misusing this step because I can't find many examples online. I have found some relevant issues here, but none of them is of any help to me.
Â