From 7094d75d91f78fdbb8a6f8104b8b3cfa4a6085a6 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 3 Jun 2025 19:40:43 +0200 Subject: [PATCH] try git ref --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2b9fabf..ca9a1a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,12 +5,14 @@ pipeline { returnStdout: true, script: 'git describe --tags --exact-match 2>/dev/null || git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD' ).trim()}""" + CONTAINER_REGISTRY = credentials('container_registry') + REPO_NAME = env.GIT_URL.replaceFirst(/^.*\/([^\/]+?).git$/, '$1') } stages { stage('Build') { when { tag "*" } steps { - sh "podman build -t docker.io/thallian/atuin:${env.GIT_REF} ." + sh "podman build -t ${CONTAINER_REGISTRY}/${REPO_NAME}:${env.GIT_REF} ." } } stage('Push') { @@ -19,7 +21,7 @@ pipeline { withCredentials([usernamePassword(credentialsId: 'dockerhub', usernameVariable: 'REG_USERNAME', passwordVariable: 'REG_PASSWORD')]) { sh ''' podman login docker.io -u $REG_USERNAME -p $REG_PASSWORD - podman push docker.io/thallian/atuin:${GIT_REF} + podman push ${CONTAINER_REGISTRY}/${REPO_NAME}:${GIT_REF} ''' } }