Open jira-importer opened 8 years ago
nux:
BTW for standard "Execute shell" step there is a better workaround - you can simply add `set +x` command to disable echo. However this doesn't work for the SSH plugin.
It looks like there is already a workaround for this, I would recommend using that workaround.
I agree this makes logs so much harder to read with no added value.
Unless I'm mistaken you would have to set +x for every single shell, some of my scripts have 100's. This is not an adequate workaround.
Hi Maciej Jaros, which Operating System is Jenkins running on?
Sorry Maciej Jaros, which Operating System are you sending the commands to?
nux:
I'm using Debian 9, but I used much older linux before and it also didn't work...
On which system and/or plugin version does it suppose to work?
I was wondering if /bin/bash made sense on the machine you are sending the commands.
It was a long time ago, but I remember that I finally managed not to need to disable echo of executed commands, when removing all the sensitive data in the commands.
I've seen you reported this issue because of a log less clear to read and harder to inspect. In that case, please, check that /bin/bash makes sense on the machine you are sending the commands.
I think that only:
set +x
works on the machine where Jenkins is running (Execute shell step), because the use of Unix Shell is implicit. When sending commands (Publish over SSH step), I had to make explicit the use of Unix Shell.
In other words:
#!/bin/bash +x
is the same as:
#!/bin/bash set +x
I hope this information is useful for you in order to find out the solution. Otherwise, so sorry if my comment/workaround made this issue to be resolved. Just Reopen Issue in order to get a solution for you.
nux:
Problem is that Jenkins displays the information. Not really echo from console.
Actual workaround is not to use Publish over SSH step and use ssh command... But then you have to mess with MoTD and some tty warnings.
https://serverfault.com/questions/36421/stop-ssh-login-from-printing-motd-from-the-client/764403#764403
That also kind of defeats the purpose of setting up ssh connections in Jenkins. So would be better to simply fix SSH in Jenkins.
To be clear, do you just not want the commands echo'd, or the full stdout/stderr from the execution of the commands?
nux:
I don't want the commands from Publish over SSH step to be shown in Jenkins job log.
Commands which should not be shown because they can contain passwords or because they are simply long and confusing.
What I decided to do was wrap the command output in a check for verbose output. I am not sure this is the best way to go, so I am soliciting feedback.
https://github.com/jenkinsci/publish-over-ssh-plugin/commit/6df164a8aa191650497c4416d2364c72682e364d
Please add an option to disable echo of the command being executed (echo to log).
Most of the time the commands only make the log less clear to read and harder to inspect.
Current workaround is to put commands in a script and just execute the script. This however is not a viable workaround in all cases.
Originally reported by nux, imported from: Option to disable echo of executed commands