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

Publish Over SSH plugin: shebang is fully ignored

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Labels:
      None
    • Environment:
      Ubuntu-14.04, docker 1.12.1, docker image: jenkins:latest (jenkins 2.7.2), publish-over-ssh 1.14
    • Similar Issues:

      Description

      Hello,

      I'm using latest version of Jenkins from official docker repo. And currently it's not possible to execute a code in the bash shell. It always executes in /bin/sh instead (which in Ubuntu is a link to dash shell).

      The following code give me - "/bin/sh".

      #!/bin/bash
      echo ${SHELL}
      

      I have tested the same project (a simple freestyle job) on Jenkins 1.65x and it works fine.

        Attachments

          Activity

          Hide
          alex_hha Alex Domoradov added a comment -

          Any updates?

          Show
          alex_hha Alex Domoradov added a comment - Any updates?
          Hide
          slide_o_mix Alex Earl added a comment -

          The commands that you are executing are not run under the shell, it's like the commands are being executed as if you typed them one by one. If you want to do this, you would need to copy the shell script over to the server, then you could do /bin/bash yourfile.sh. This is different from the sh step for instance, where a shell script is created and then executed.

          Show
          slide_o_mix Alex Earl added a comment - The commands that you are executing are not run under the shell, it's like the commands are being executed as if you typed them one by one. If you want to do this, you would need to copy the shell script over to the server, then you could do /bin/bash yourfile.sh. This is different from the sh step for instance, where a shell script is created and then executed.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              alex_hha Alex Domoradov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: