kossmoboleat
kossmoboleat

Reputation: 1941

Use ssh script return value in Jenkins

We're deploying our application using SSH scripts. For the production stage we need to figure out which out of two clusters is currently active. This can only be achieved reliably by running a command on a remote host and interpreting its output. Unfortunately there's no SSH plugin that does that AFAIK.

They only seem to be able to interpret if the SSH script return value was different from zero.

Currently I only see two undesirable solutions:

Upvotes: 2

Views: 2955

Answers (1)

Raghav Vaidhyanathan
Raghav Vaidhyanathan

Reputation: 905

Ok based on what you mentioned in the comment, I think you can try something like given in here and then copy back that file to jenkins using ftp and then read the file contents.

Or you can have the whole process orchestrated in an Ant script by using SSHExec task and get the output in Ant

Upvotes: 1

Related Questions