Hello Everyone,
I am using "Execute shell script on remote host using SSH" under Build section of the Job config with lines of shell script placed there.
And see all lines from the shell script are logged into Jenkins console log during job's execution.
Ex:
tarted by user anonymous [EnvInject] - Loading node environment variables. Building in workspace ... [EnvInject] - Executing scripts and injecting environment variables after the SCM step.
executing script: target_env="dev"
var1=${target_env}
key="test123" branchName=dev_feature1 startDeploy()
case "$var1" indev ).
.
.
esac
So is there a way to disable/hide shell script contents from logging into Jenkins console output of the job.
Sent from Outlook
You can hide your output away from the script by redirecting the output to /dev/null but I think this the most you can do – the commands that you write will still be displayed.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/HK2PR03MB1857371344C566364709E32FA8A90%40HK2PR03MB1857.apcprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
#!/bin/sh -xe#!/bin/sh -e
# add whatever you'd like to doThanks for the response.
Tried with "#!/bin/sh -e". Still everything gets logged to console.
Sent from Outlook
#!/bin/sh -eecho hiecho world[example] $ /bin/sh -e /tmp/hudson8709802188364684962.sh
hi
world
echo bye
echo world[example] $ /bin/sh -xe /tmp/hudson8136234464915657626.sh
+ echo bye
bye
+ echo world
world
Thanks Victor.
I assume you are running the shell commands on the same host machine (local). Did you try running on remote host ?
Here is the screenshot of the config I tired.

Sent from Outlook
Hi,