This commit is contained in:
Nana Janashia
2021-04-04 09:39:09 +02:00
parent 24827f1eaa
commit 76a9356555
2 changed files with 66 additions and 18 deletions

34
Jenkinsfile-v3 Normal file
View File

@@ -0,0 +1,34 @@
def gv
pipeline {
agent any
stages {
stage("build jar") {
steps {
script {
echo "building the application..."
sh 'mvn package'
}
}
}
stage("build image") {
steps {
script {
echo "building the docker image..."
withCredentials([usernamePassword(credentialsId: 'docker-hub-repo', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh 'docker build -t nanajanashia/demo-app:jma-2.0 .'
sh "echo $PASS | docker login -u $USER --password-stdin"
sh 'docker push nanajanashia/demo-app:jma-2.0'
}
}
}
}
stage("deploy") {
steps {
script {
echo 'deploying the application...'
}
}
}
}
}