Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54857

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

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Won't Do
    • Icon: Minor Minor
    • durable-task-plugin
    • 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"

            Unassigned Unassigned
            onodera Alexey Marin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: