fix jenkins ci/cd

main
Cizz22 1 year ago
parent e7fd8001be
commit 2ccdf70d9b

5
Jenkinsfile vendored

@ -9,7 +9,6 @@ pipeline {
// Replace with your image name
IMAGE_NAME = 'oh-service'
// Variable for Git commit hash
GIT_COMMIT_HASH = ''
}
stages {
@ -36,6 +35,10 @@ pipeline {
steps {
script {
// Build with commit hash tag
if (!GIT_COMMIT_HASH) {
GIT_COMMIT_HASH = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
}
sh '''
docker build -t ${DOCKER_HUB_USERNAME}/${IMAGE_NAME}:${GIT_COMMIT_HASH} .
docker tag ${DOCKER_HUB_USERNAME}/${IMAGE_NAME}:${GIT_COMMIT_HASH} ${DOCKER_HUB_USERNAME}/${IMAGE_NAME}:latest

Loading…
Cancel
Save