This plugin has not been updated much the last 2-3 years. https://github.com/jenkinsci/ssh-steps-plugin I wonder if I should abandon it.
onsdag 19. januar 2022 kl. 12:33:24 UTC+1 skrev Sverre Moe: > When I have a script with multiple lines, I do not get any output from the > script in the console output of the pipeline job. > > > https://www.jenkins.io/doc/pipeline/steps/ssh-steps/#sshscript-ssh-steps-sshscript-execute-scriptfile-on-remote-node > > pipeline { > agent { > label 'docker-agent' > } > environment { > SERVER_CREDS = credentials('server-user') > } > stages { > stage('Deploy') { > steps { > echo "Deploy to server" > script { > def remote = [:] > remote.name = 'server' > remote.host = 'server.company.com' > remote.user = env.SERVER_CREDS_USR > remote.password = env.SERVER_CREDS_PSW > remote.allowAnyHosts = true > sshScript( > remote: remote, > script: 'deploy.sh' > ) > } > } > } > } > } > > > If I have more than one line in the script deploy.sh, I do not get any > output > > It seems if I have multiple lines that produce output, then I do not get > any output. > If I have multiple lines, and only the last command there has an output, > then I get the output in the pipeline console output. > > This works: > #!/bin/bash > DIR=/tmp > ls -ltr $DIR > > This does not work: > #!/bin/bash > DIR=/tmp > ls -ltr $DIR > ls -ltr > -- 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-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5b73953c-ac0c-45d4-826a-6b8ccb8d3a37n%40googlegroups.com.