Commit 5356b9f6 authored by Fernando Vazquez's avatar Fernando Vazquez

Added ssh step

parent 6d38b533
FROM openjdk:11-jre-slim
COPY target/spring-boot-complete-0.0.1-SNAPSHOT.jar /usr/local/lib/hello.jar
EXPOSE 8085
ENTRYPOINT ["java","-jar","/usr/local/lib/hello.jar"]
......@@ -10,6 +10,8 @@ pipeline {
NEXUS_URL = "34.69.185.118:8081"
NEXUS_REPOSITORY = "maven-nexus-jenkins-repo"
NEXUS_CREDENTIAL_ID = "nexus-credentials"
USER = "root"
REMOTE_AGENT = "34.168.252.248"
}
stages {
......@@ -98,5 +100,16 @@ pipeline {
}
}
}
stage("Build Docker Image and Helm Deploy to Kubernetes"){
steps{
sshagent(credentials: ['ssh-cred']){
sh '''
[ -d ~/.ssh ] || mkdir ~/.ssh && chmod 0700 ~/.ssh
ssh-keyscan -t rsa,dsa ${REMOTE_AGENT} >> ~/.ssh/known_hosts
ssh ${USER}@${REMOTE_AGENT} "echo hello vm!"
'''
}
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment