Edit Jenkinsfile

This commit is contained in:
Viktoriia Karpenko 2024-12-11 18:36:35 +02:00
parent 755b8b319a
commit bf22d5a432

11
Jenkinsfile vendored
View file

@ -1,5 +1,10 @@
pipeline { pipeline {
agent any agent any
environment {
GIT_COMMIT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
}
stages { stages {
stage ('Checkstyle') { stage ('Checkstyle') {
steps { steps {
@ -18,5 +23,11 @@ pipeline {
archiveArtifacts artifacts: 'target/*.jar', allowEmptyArchive: false archiveArtifacts artifacts: 'target/*.jar', allowEmptyArchive: false
} }
} }
stage ('Creating Docker image') {
steps {
sh 'docker build -t vkarpenko02/spring-petclinic:${GIT_COMMIT} .'
sh 'docker push vkarpenko02/mr'
}
}
} }
} }