Files
java-maven-app/Jenkinsfile
2021-04-07 11:43:54 +02:00

19 lines
698 B
Groovy

pipeline {
agent any
stages {
stage("copy files to ansible server") {
steps {
script {
echo "copying all neccessary files to ansible control node"
sshagent(['ansible-server-key']) {
sh "scp -o StrictHostKeyChecking=no ansible/* root@167.99.136.157:/root"
withCredentials([sshUserPrivateKey(credentialsId: 'ec2-server-key', keyFileVariable: 'keyfile', usernameVariable: 'user')]) {
sh 'scp $keyfile root@167.99.136.157:/root/ssh-key.pem'
}
}
}
}
}
}
}