0

I'm using Bamboo as a CI (living on an AWS linux box) and have setup an SSH task where by I wish to invoke a jar file on another, physical, Windows machine. I have setup an SSH client on the Windows machine (Dameware SSH) and have setup a user called admin / admin.

The jar file runs a tool called SeInterpreter to run interpret .json selenium tests into webdriver tests.

I have a lack of knowledge around the format for the shell script I need to run in order to invoke the jar on the remote machine. I have cobbled the following together:

ssh admin@L-IS03159.nt.ad.local cmd /c cd /d "c:/SeInterpreterB11" cmd /c java -jar SeInterpreter.jar --driver=Remote --driver.browserName=firefox --driver.url=http://L-IS03159.nt.ad.local:4444/wd/hub/ C:/seleniumBuilderPOC/tests/loadHomePageSearchHomepage.json

The error from Bamboo is:

23-Jul-2014 15:36:12    Unable to execute command or shell on remote system: Failed to Execute process.
23-Jul-2014 15:36:12    Result: exit code = -1
23-Jul-2014 15:36:12    SSH command failed. Failing build.

Can anyone see obvious errors in the script syntax?

Steerpike
  • 1,712
  • 6
  • 38
  • 71

1 Answers1

0

Your command line has the following form:

ssh user@hostname cmd /c [cd command] cmd /c [java command]

Try the following form, instead:

ssh user@hostname cmd /c "[cd command] && [java command]"

&& is a command separator in cmd.exe.

You may run into issues with the quotation marks in cd /d "c:/SeInterpreterB11". Since there are no spaces in this path, the quotes aren't necessary. Consider removing them to avoid headaches dealing with quote escaping.

Chad Nouis
  • 6,861
  • 1
  • 27
  • 28