Allow durable task to run batch/shell/powershell files from the repo

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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"

            Assignee:
            Unassigned
            Reporter:
            Alexey Marin
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: