Files
java-maven-app/Jenkinsfile
2020-11-18 11:59:09 +00:00

30 lines
728 B
Groovy

pipeline {
agent none
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 'ec2-user@35.180.251.121 ${dockerRun}'
}
}
}
}
}
}