Here\'s my Jenkins 2.x pipeline:
node (\'master\'){
stage \'Checkout\'
checkout scm
stage \"Build Pex\"
sh(\'build.sh\')
}
When
You can enclose your actions in dir
block.
checkout scm
stage "Build Pex"
dir ('') {
sh('./build.sh')
}
... or ..
checkout scm
stage "Build Pex"
sh(""" /build.sh""")
...
is place holder your actual directory. By default it is a relative path to workspace. You can define absolute path, if you are sure this is present on the agent.