Here\'s my Jenkins 2.x pipeline:
node (\'master\'){
stage \'Checkout\'
checkout scm
stage \"Build Pex\"
sh(\'build.sh\')
}
When
I was able to get my script execution working with a simplified derivative of Rafael Manzoni's response. I wondered about the whole "JOB_NAME@script" thing and found that unnecessary, at least for declarative using our version of Jenkins. Simply set the access permissions on the workspace. No need to go any deeper than that.
stage('My Stage') {
steps {
sh "chmod +x -R ${env.WORKSPACE}"
sh "./my-script.sh"
}
}