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 source="https://github.com/status-im/telemetry"
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

40
Jenkinsfile vendored
View File

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