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

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

    Details

    • Type: New Feature
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: durable-task-plugin
    • Labels:
      None
    • Environment:
      Durable Task Plugin: 1.28
    • Similar Issues:

      Description

      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"

        Attachments

          Activity

          onodera Alexey Marin created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              onodera Alexey Marin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: