ci: push docker image to harbor

This commit is contained in:
Siddarth Kumar 2024-10-03 07:30:15 +05:30
parent 881bd12992
commit 5c674afe50
No known key found for this signature in database
GPG Key ID: 599D10112BF518DB

13
Jenkinsfile vendored
View File

@ -7,6 +7,11 @@ pipeline {
defaultValue: params.IMAGE_TAG ?: '', defaultValue: params.IMAGE_TAG ?: '',
description: 'Optional Docker image tag to push.' description: 'Optional Docker image tag to push.'
) )
string(
name: 'DOCKER_REGISTRY',
description: 'Docker registry ',
defaultValue: params.DOCKER_REGISTRY ?: 'harbor.status.im',
)
} }
options { options {
@ -19,7 +24,7 @@ pipeline {
} }
environment { environment {
IMAGE_NAME = 'statusteam/logos-dashboard' IMAGE_NAME = 'acid-info-private/logos-ordinals-dashboard'
NEXT_PUBLIC_SITE_URL = "https://${env.JOB_BASE_NAME}" NEXT_PUBLIC_SITE_URL = "https://${env.JOB_BASE_NAME}"
} }
@ -28,7 +33,7 @@ pipeline {
steps { steps {
script { script {
image = docker.build( image = docker.build(
"${IMAGE_NAME}:${env.GIT_COMMIT.take(8)}" "${DOCKER_REGISTRY}/${IMAGE_NAME}:${GIT_COMMIT.take(8)}",
) )
} }
} }
@ -37,7 +42,7 @@ pipeline {
stage('Push') { stage('Push') {
steps { steps {
script { script {
withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) { withDockerRegistry([credentialsId: 'harbor-acid-info-private-robot', url: 'https://${DOCKER_REGISTRY}']) {
image.push() image.push()
} }
} }
@ -48,7 +53,7 @@ pipeline {
when { expression { params.IMAGE_TAG != '' } } when { expression { params.IMAGE_TAG != '' } }
steps { steps {
script { script {
withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) { withDockerRegistry([credentialsId: 'harbor-acid-info-private-robot', url: 'https://${DOCKER_REGISTRY}']) {
image.push(params.IMAGE_TAG) image.push(params.IMAGE_TAG)
} }
} }