Skip to content

Commit

Permalink
Jenkinsfile: update registry
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Pentori <[email protected]>
  • Loading branch information
apentori committed Feb 14, 2024
1 parent 4e5003a commit 996c60f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ pipeline {
description: 'Enable to deploye the Docker image.',
defaultValue: false,
)
string(
name: 'DOCKER_CRED',
description: 'Name of Docker Registry credential.',
defaultValue: params.DOCKER_CRED ?: 'harbor-telemetry-robot',
)
string(
name: 'DOCKER_REGISTRY_URL',
description: 'URL of the Docker Registry',
defaultValue: params.DOCKER_REGISTRY_URL ?: 'https://harbor.status.im'
)
}

options {
Expand All @@ -20,8 +30,8 @@ pipeline {
}

environment {
IMAGE_NAME = "statusteam/telemetry"
IMAGE_DEFAULT_TAG = "${env.GIT_COMMIT.take(7)}"
IMAGE_NAME = "status-im/telemetry"
IMAGE_DEFAULT_TAG = "latest"
IMAGE_DEPLOY_TAG = "deploy"
}

Expand All @@ -34,7 +44,7 @@ pipeline {

stage('Push') { steps { script {
withDockerRegistry([
credentialsId: "dockerhub-statusteam-auto"
credentialsId: params.DOCKER_CRED, url: params.DOCKER_REGISTRY_URL
]) {
image.push()
}
Expand All @@ -44,10 +54,10 @@ pipeline {
when { expression { params.DEPLOY } }
steps { script {
withDockerRegistry([
credentialsId: "dockerhub-statusteam-auto"
credentialsId: params.DOCKER_CRED, url: params.DOCKER_REGISTRY_URL
]) {
image.push(env.IMAGE_DEPLOY_TAG)
}
} } }
} // stages
} // pipeline
}

0 comments on commit 996c60f

Please sign in to comment.