Edit Jenkinsfile

This commit is contained in:
Viktoriia Karpenko 2024-12-18 14:30:55 +02:00
parent 40a4a597d4
commit bd2041a794

2
Jenkinsfile vendored
View file

@ -3,6 +3,7 @@ pipeline {
environment {
GIT_COMMIT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
DOCKER_CREDS = credentials('docker_key')
}
stages {
@ -26,6 +27,7 @@ pipeline {
stage ('Creating Docker image') {
steps {
sh 'docker build -t vkarpenko02/mr:${GIT_COMMIT} .'
sh 'echo ${DOCKER_HUB_CREDS_PSW} | docker login -u ${DOCKER_HUB_CREDS_USR} --password-stdin'
sh 'docker push vkarpenko02/mr:${GIT_COMMIT}'
}
}