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

"Prefix/Suffix Start Slave Command" does not automatically append/prepend "&&"

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If the user wants to add a unix command like "export SOMETHING=something" to "Prefix Start Slave Command" or "Suffix Start Slave Command" in a slave configuration,
      the next slave launch will most likely fail, because "&&" is not automatically appended/prepended to the entered command(s).

      Instead of letting the user find out the hard way, Jenkins should append/prepend "&&" if necessary.

        Attachments

          Activity

          Hide
          danielbeck Daniel Beck added a comment -

          There are shells that do not support && (notably fish).

          Show
          danielbeck Daniel Beck added a comment - There are shells that do not support && (notably fish ).
          Hide
          fredg Fred G added a comment -

          OK. I wasn't aware of that. So the current shell needs to be detected as well.

          Show
          fredg Fred G added a comment - OK. I wasn't aware of that. So the current shell needs to be detected as well.
          Hide
          danielbeck Daniel Beck added a comment -

          An easy solution would be to (optionally create a temporary script file and) run multiple commands one after the other in the shell. One per line. All shells should support that.

          But there's a problem with that: Any change here will be backwards incompatible.

          {{LANG=en_US.UTF-8 }} should work like a charm in bash as a prefix command, but not if run independently.

          I don't see the benefit justifying the cost here.

          Show
          danielbeck Daniel Beck added a comment - An easy solution would be to (optionally create a temporary script file and) run multiple commands one after the other in the shell. One per line. All shells should support that. But there's a problem with that: Any change here will be backwards incompatible. {{LANG=en_US.UTF-8 }} should work like a charm in bash as a prefix command, but not if run independently. I don't see the benefit justifying the cost here.
          Hide
          fredg Fred G added a comment -

          I agree that a solution that covers all corner cases might be costly. At the same time I value the cost of having a user stumbling over this bug quite high as well.
          At the very least, both fields need a info/help text explaining the possible problems.

          Show
          fredg Fred G added a comment - I agree that a solution that covers all corner cases might be costly. At the same time I value the cost of having a user stumbling over this bug quite high as well. At the very least, both fields need a info/help text explaining the possible problems.
          Hide
          olivergondza Oliver Gondža added a comment -

          I am not really a fan of this string concatenation approach but adding operands is even more surprising. Current documentation says:

          The actual command being issued will be the concatenation of Prefix Start Slave Command, the command to launch slave.jar and Suffix Start Slave Command, without any separators.

          I so reason to keep this open.

          Show
          olivergondza Oliver Gondža added a comment - I am not really a fan of this string concatenation approach but adding operands is even more surprising. Current documentation says: The actual command being issued will be the concatenation of Prefix Start Slave Command, the command to launch slave.jar and Suffix Start Slave Command, without any separators. I so reason to keep this open.

            People

            • Assignee:
              Unassigned
              Reporter:
              fredg Fred G
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: