I have a jenkins pipeline
pipeline {
agent any
tools{
jdk 'JDK 1.8'
}
stages {
stage('Clean') {
steps {
script {
sh 'mvn clean'
}
}
}
stage('Install'){
steps{
script{
sh 'mvn install'
}
}
}
stage('Deploy'){
steps{
script{
sh 'mvn deploy'
}
}
}
}
}
when this pipeline is executed i want to ssh to a system and use a .ppk file as cred which is stored on my host machine, below is the command to ssh for your refernce
ssh -i "{path to ppk file}" [email protected]
Also when i do mvn install i get a .war file in jenkins logs whose path i want to access in order to deploy.
aws s3 --profile abc cp <war s3 path> abc.war
Please help me do that :)
i normally follow this,you can use the sshagent plugin to temporarily add your SSH key (xyz.pem) to the SSH agent and then execute SSH commands to connect to your EC2 instance.