Files
java-maven-app/Jenkinsfile
2020-11-18 12:01:49 +00:00

30 lines
759 B
Groovy

pipeline {
agent any
stages {
stage('test') {
steps {
script {
echo "Testing the application..."
}
}
}
stage('build') {
steps {
script {
echo "Building the application..."
}
}
}
stage('deploy') {
steps {
script {
def dockerCmd = 'docker run -p 3080:3080 -d nanajanashia/demo-app:1.0'
sshagent(['ec2-server-key']) {
sh 'ssh -o StrictHostKeyChecking=no ec2-user@35.180.251.121 ${dockerRun}'
}
}
}
}
}
}