chore: use Harbor docker registry, handle develop branch (#5)

https://github.com/status-im/infra-sites/issues/42

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2025-04-18 12:31:01 +02:00 committed by GitHub
parent 6346620989
commit 18de726945
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

27
Jenkinsfile vendored
View File

@ -7,9 +7,14 @@ pipeline {
parameters { parameters {
string( string(
name: 'IMAGE_TAG', name: 'IMAGE_TAG',
defaultValue: params.IMAGE_TAG ?: '', defaultValue: params.IMAGE_TAG ?: deployBranch(),
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 {
@ -22,22 +27,26 @@ pipeline {
} }
environment { environment {
IMAGE_NAME = 'statusteam/rln-keystore-management' IMAGE_NAME = 'wakuorg/rln-keystore-management'
NEXT_PUBLIC_SITE_URL = "https://${env.JOB_BASE_NAME}" NEXT_PUBLIC_SITE_URL = "https://${deployDomain()}"
} }
stages { stages {
stage('Build') { stage('Build') {
steps { steps {
script { script {
image = docker.build("${IMAGE_NAME}:${GIT_COMMIT.take(8)}") image = docker.build(
"${DOCKER_REGISTRY}/${IMAGE_NAME}:${GIT_COMMIT.take(8)}"
)
} }
} }
} }
stage('Push') { stage('Push') {
steps { script { steps { script {
withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) { withDockerRegistry([
credentialsId: 'harbor-wakuorg-robot', url: "https://${DOCKER_REGISTRY}",
]) {
image.push() image.push()
} }
} } } }
@ -46,7 +55,9 @@ pipeline {
stage('Deploy') { stage('Deploy') {
when { expression { params.IMAGE_TAG != '' } } when { expression { params.IMAGE_TAG != '' } }
steps { script { steps { script {
withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) { withDockerRegistry([
credentialsId: "harbor-wakuorg-robot", url: "https://${DOCKER_REGISTRY}",
]) {
image.push(params.IMAGE_TAG) image.push(params.IMAGE_TAG)
} }
} } } }
@ -57,3 +68,7 @@ pipeline {
cleanup { cleanWs() } cleanup { cleanWs() }
} }
} }
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
def deployDomain() { isMasterBranch() ? 'waku.org' : 'dev.waku.org' }