Elad Benda2 Elad Benda2 - 1 year ago 100
Java Question

Jenkins drops flags for ssh command?

I have this step in Jenkins build

jenkins screenshot

echo "ws is"
echo ${WORKSPACE}/build/libs/RoutingRegression-fat-1.0.jar

scp ${WORKSPACE}/build/libs/RoutingRegression-fat-1.0.jar root@${REGR_IP_ADDR}:
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@${REGR_IP_ADDR}
./opt/waze/bin/regression/deploy_jar.sh 1

but in the run console I don't see the
ssh flags
I have added

14:05:02 + echo 'ws is'
14:05:02 ws is
14:05:02 + echo /data/workspace/java/RoutingRegression/route_flavor_historic_time_3/ws/build/libs/RoutingRegression-fat-1.0.jar
14:05:02 /data/workspace/java/RoutingRegression/route_flavor_historic_time_3/ws/build/libs/RoutingRegression-fat-1.0.jar

14:05:02 + scp /data/workspace/java/RoutingRegression/route_flavor_historic_time_3/ws/build/libs/RoutingRegression-fat-1.0.jar root@
14:05:03 Host key verification failed.
14:05:03 lost connection
14:05:03 Build step 'Execute shell' marked build as failure

Answer Source

You don't have there any scp flags. You added the flags to the ssh command (it is not executed, probably because the previous scp command failed).

Add the flags to the scp command.