Created
June 26, 2019 15:36
-
-
Save ianibo/fdc719f8c9f09d9c924daa47c6ddf95f to your computer and use it in GitHub Desktop.
Script in jenkins to deploy via ssh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set up credentials, then use jenkins bindings/SSH User Key File and put SSHKEYFILE in env var | |
echo BUILD STEP | |
export HOST_IP=`/sbin/ip route|awk '/default/ { print $3 }'` | |
echo SSH KEYFILE is "$SSHKEYFILE" | |
/sbin/ip route | |
cat "$SSHKEYFILE" | |
echo Host IP is $HOST_IP - ssh the war file there and deploy it | |
ssh -v -o StrictHostKeyChecking=no -i "$SSHKEYFILE" kbpluslive@$HOST_IP "/..../deploy.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment