Last active
July 28, 2020 08:42
-
-
Save anilnautiyal/b64e88e59c52a73d2d8957add446c1bd to your computer and use it in GitHub Desktop.
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
pipeline { | |
agent 'any' | |
options { | |
skipStagesAfterUnstable() | |
} | |
stages { | |
// Build | |
stage('BuildMaster') { | |
steps { | |
sh """ | |
echo "${env.HOST}" | |
""" | |
} | |
} | |
// test | |
stage('test'){ | |
// code for testing | |
steps { | |
sh """ | |
echo "${env.HOST}" | |
""" | |
} | |
} | |
// Deploy | |
stage('DeployMaster') { | |
steps { | |
//deploy steps goes here | |
sh """ | |
sshpass -p '${env.PASSWORD}' rsync --progress -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 22" /var/lib/jenkins/jenkins/workspace/git-training/ ${env.USERNAME}@${env.HOST}:/document-path/ | |
""" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment