Update Jenkinsfile

This commit is contained in:
Stas Bezuhlyi 2021-04-08 23:20:14 +03:00 committed by GitHub
parent 0a4d0fa2ca
commit 006858e2ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

17
Jenkinsfile vendored
View file

@ -23,7 +23,7 @@ pipeline {
'''
}
}
stage('CREATE ARTIFACT') {
/* stage('CREATE ARTIFACT') {
steps {
echo 'Creating Docker Image...'
sh """#!/bin/bash -xe
@ -41,7 +41,20 @@ pipeline {
"""
}
}
}
} */
stage('Push images') {
steps {
script {
def dockerImage = docker.build("${env.IMAGE_NAME}", "-f ${env.DOCKERFILE_NAME} .")
docker.withRegistry('', 'dockerhub_id') {
dockerImage.push()
dockerImage.push("latest")
}
echo "Pushed Docker Image: ${env.IMAGE_NAME}"
}
sh "docker rmi ${env.IMAGE_NAME} ${env.IMAGE_NAME_LATEST}"
}
}
stage('Deploy') {
steps {