diff --git a/Jenkinsfile b/Jenkinsfile index 0504fe25b..985a13430 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,10 @@ pipeline { agent any + + environment { + GIT_COMMIT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() + } + stages { stage ('Checkstyle') { steps { @@ -18,5 +23,11 @@ pipeline { 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' + } + } } } \ No newline at end of file