user5154816
user5154816

Reputation:

How to pass parameters to remote shell in jenkins job

I am trying to pass a parameter to remote machine with ssh. I have used ssh plugin to add remote host.

# works for local shell
+ echo sdk
sdk
executing script:
BUILD="sdk"

# doesn't work for remote shell
export BUILD
echo "$BUILD"
BUILD=sdk: Command not found.
export: Command not found.
BUILD: Undefined variable.
[SSH] exit-status: 1
Build step 'Execute shell script on remote host using ssh' marked build as failure
Finished: FAILURE

I tried with double quotes, curly braces, export, but with nothing I am able to get the value of the parameter on remote shell. Can someone let me know if I am missing any configuration on jenkins?

Upvotes: 1

Views: 1585

Answers (1)

user5154816
user5154816

Reputation:

The issue was with remote machine's default shell. It was tcsh, changed default shell to bash and it resolved the issue.

Upvotes: 1

Related Questions