try git ref
Some checks are pending
Build Multiarch Container Image / call-reusable-workflow (push) Waiting to run

This commit is contained in:
Sebastian Hugentobler 2025-06-03 19:40:43 +02:00
parent 9e35d642b8
commit 7094d75d91
Signed by: shu
SSH key fingerprint: SHA256:ppcx6MlixdNZd5EUM1nkHOKoyQYoJwzuQKXM6J/t66M

6
Jenkinsfile vendored
View file

@ -5,12 +5,14 @@ pipeline {
returnStdout: true, returnStdout: true,
script: 'git describe --tags --exact-match 2>/dev/null || git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD' script: 'git describe --tags --exact-match 2>/dev/null || git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD'
).trim()}""" ).trim()}"""
CONTAINER_REGISTRY = credentials('container_registry')
REPO_NAME = env.GIT_URL.replaceFirst(/^.*\/([^\/]+?).git$/, '$1')
} }
stages { stages {
stage('Build') { stage('Build') {
when { tag "*" } when { tag "*" }
steps { 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') { stage('Push') {
@ -19,7 +21,7 @@ pipeline {
withCredentials([usernamePassword(credentialsId: 'dockerhub', usernameVariable: 'REG_USERNAME', passwordVariable: 'REG_PASSWORD')]) { withCredentials([usernamePassword(credentialsId: 'dockerhub', usernameVariable: 'REG_USERNAME', passwordVariable: 'REG_PASSWORD')]) {
sh ''' sh '''
podman login docker.io -u $REG_USERNAME -p $REG_PASSWORD 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}
''' '''
} }
} }