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

Support build variables (substitution variables) during command execution

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • ssh-plugin
    • None

      This plugin doesn't seem to support build variables. Attached are three images showing:

      1. Build parameters for a job
      2. A build step of "Execute shell script on remote host using ssh"
      3. The resulting console output.

      You'll notice the variable is not substituted.

          [JENKINS-12191] Support build variables (substitution variables) during command execution

          edmund_wagner added a comment -

          fixed in plugin version 1.6

          edmund_wagner added a comment - fixed in plugin version 1.6

          Hi,
          I've got the exact same behaviour with ssh plugin version 2.4

          Matthieu Bollot added a comment - Hi, I've got the exact same behaviour with ssh plugin version 2.4

          Nikita Danilov added a comment - - edited

          Hello,
          We have the same issue with SSH plugin versions 2.4.

          In 1.6 version plugin translates script to the server like this:

          export MY_VAR="asd"
          echo $MY_VAR

          Variable value sent via export command. But unfortunately our server cannot to process complex scripts, server is awaiting just 1 command with N parameters.
          Is it possible to implement direct variables substition in script, without "export"?

          Nikita Danilov added a comment - - edited Hello, We have the same issue with SSH plugin versions 2.4. In 1.6 version plugin translates script to the server like this: export MY_VAR= "asd" echo $MY_VAR Variable value sent via export command. But unfortunately our server cannot to process complex scripts, server is awaiting just 1 command with N parameters. Is it possible to implement direct variables substition in script, without "export"?

          nikita_danilov you should report your issue as a separate ticket.

          The original issue has been fixed in SSH 2.5

          Łukasz Jąder added a comment - nikita_danilov you should report your issue as a separate ticket. The original issue has been fixed in SSH 2.5

          Closing - this has been fixed by exporting used env variables before the script.

          It works in recently released SSH 2.5.

          Łukasz Jąder added a comment - Closing - this has been fixed by exporting used env variables before the script. It works in recently released SSH 2.5.

            Unassigned Unassigned
            leojhartiv leojhartiv
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: