Edit Jenkinsfile

This commit is contained in:
Viktoriia Karpenko 2024-12-12 17:11:39 +02:00
parent b14897a798
commit 1f598ff6b2

9
Jenkinsfile vendored
View file

@ -24,14 +24,9 @@ pipeline {
} }
} }
stage ('Creating Docker image') { stage ('Creating Docker image') {
agent {
docker {
image 'docker:latest'
}
}
steps { steps {
sh 'docker build -t vkarpenko02/spring-petclinic:${GIT_COMMIT} .' sh 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/workspace -w /workspace docker:20.10 build -t vkarpenko02/spring-petclinic:${GIT_COMMIT} .'
sh 'docker push vkarpenko02/mr' sh 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker:20.10 push vkarpenko02/spring-petclinic:${GIT_COMMIT}'
} }
} }
} }