-
New Feature
-
Resolution: Won't Do
-
Minor
-
None
-
Durable Task Plugin: 1.28
Right now if you extract your shell script into a file that is distributed with your source code (for example, to use it for semi-automated deployment), you have to invoke it using some weird incantations (https://stackoverflow.com/questions/38143485/how-do-i-make-jenkins-2-0-execute-a-sh-command-in-the-same-directory-as-the-chec):
sh "chmod +x -R ${env.WORKSPACE}/../${env.JOB_NAME}@script" sh "${env.WORKSPACE}/../${env.JOB_NAME}@script/script.sh"
It would be much more convenient if there was a named parameter you could use to invoke one of your scripts directly:
sh file: "somepath/deploy.sh" bat file: "somepath/deploy.bat" powershell file: "somepath/deploy.ps1"
By default it should look for files in the checked out repo, but you could pass an absolute path too:
sh file: "/var/lib/jenkins/deploy.sh" bat file: "/var/lib/jenkins/deploy.sh" powershell file: "/var/lib/jenkins/deploy.sh"