ci: use harbor.status.im to push docker images

https://github.com/waku-org/storenode-messages-counter/issues/9

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-05-21 08:35:17 +02:00
parent 98a7a2e74b
commit 4d1a7f822c
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
2 changed files with 19 additions and 22 deletions

View File

@ -13,6 +13,7 @@ FROM alpine:3.14
LABEL maintainer="jakub@status.im" LABEL maintainer="jakub@status.im"
LABEL source="https://github.com/status-im/telemetry" LABEL source="https://github.com/status-im/telemetry"
LABEL description="Opt-in message reliability metrics service" LABEL description="Opt-in message reliability metrics service"
LABEL commit="unknown"
COPY --from=builder /go/src/github.com/status-im/telemetry/build/server /usr/local/bin/telemetry COPY --from=builder /go/src/github.com/status-im/telemetry/build/server /usr/local/bin/telemetry

40
Jenkinsfile vendored
View File

@ -2,10 +2,10 @@ pipeline {
agent { label 'linux' } agent { label 'linux' }
parameters { parameters {
booleanParam( string(
name: 'DEPLOY', name: 'IMAGE_TAG',
description: 'Enable to deploye the Docker image.', defaultValue: params.IMAGE_TAG ?: 'latest',
defaultValue: false, description: 'Optional Docker image tag to push.'
) )
} }
@ -20,33 +20,29 @@ pipeline {
} }
environment { environment {
IMAGE_NAME = "statusteam/telemetry" DOCKER_REGISTRY = 'harbor.status.im'
IMAGE_NAME = "wakuorg/telemetry"
IMAGE_DEFAULT_TAG = "${env.GIT_COMMIT.take(7)}" IMAGE_DEFAULT_TAG = "${env.GIT_COMMIT.take(7)}"
IMAGE_DEPLOY_TAG = "deploy"
} }
stages { stages {
stage('Build') { steps { script { stage('Build') {
image = docker.build( steps { script {
"${env.IMAGE_NAME}:${env.IMAGE_DEFAULT_TAG}" image = docker.build(
) "${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_DEFAULT_TAG}",
} } } "--build-arg='commit=${GIT_COMMIT}' .",
)
stage('Push') { steps { script { } }
withDockerRegistry([ }
credentialsId: "dockerhub-statusteam-auto"
]) {
image.push()
}
} } }
stage('Deploy') { stage('Deploy') {
when { expression { params.DEPLOY } } when { expression { params.IMAGE_TAG != '' } }
steps { script { steps { script {
withDockerRegistry([ withDockerRegistry([
credentialsId: "dockerhub-statusteam-auto" credentialsId: 'harbor-telemetry-robot',
url: 'https://${DOCKER_REGISTRY}',
]) { ]) {
image.push(env.IMAGE_DEPLOY_TAG) image.push(env.IMAGE_TAG)
} }
} } } } } }
} // stages } // stages