I'm trying to run a complete script while the ssh session is live instead of single commands.
Here is my current code:
sh "ssh -tt -o StrictHostKeyChecking=no ubuntu@IPV4_DNS uptime"
sh "ssh -v ubuntu@IPV4_DNS docker pull X:${BUILD_NUMBER}"
sh "ssh -v ubuntu@IPV4_DNS docker rm -f test"
sh "ssh -v ubuntu@IPV4_DNS docker run --name=test -d -p 3000:3000X:${BUILD_NUMBER}"
The desired code is something like this, but the following doesn't work:*
sh "ssh -tt -o StrictHostKeyChecking=no ubuntu@IPV4_DNS uptime"
sh ''' ssh -v ubuntu@IPV4_DNS docker pull X:${BUILD_NUMBER}
&& docker rm -f test && docker run --name=test -d -p 3000:3000X:${BUILD_NUMBER}
'''