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} ''' } }