Sample Header Ad - 728x90

How to run remote server shell script with environment parameters on Jenkins pipeline

0 votes
2 answers
4524 views
I am attempting to run a shell script on a remote server in jenkins scripted pipeline using the sshScript remote: remote, script: command. This line of code currently looks like this: sshScript remote: remote, script: './bash.sh' "$env.gitTag" "$env.Version" However, it keeps saying that the parameters are null there is an error being thrown. I have tried everything and cannot find an answer. I echo the parameters before they are thrown and they contain strings which I expect. 15:56:35 WARNING: Unknown parameter(s) found for class type 'org.jenkinsci.plugins.sshsteps.steps.CommandStep': script [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] } [Pipeline] // timestamps [Pipeline] End of Pipeline java.lang.IllegalArgumentException: command is null or empty at org.jenkinsci.plugins.sshsteps.steps.CommandStep$Execution.run(CommandStep.java:69) at org.jenkinsci.plugins.sshsteps.util.SSHStepExecution.lambda$start$0(SSHStepExecution.java:84) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Finished: FAILURE These are the errors being published at the end.
Asked by Connor Rasmussen (1 rep)
Jul 26, 2021, 10:05 PM
Last activity: Apr 19, 2025, 04:10 PM