pipeline { agent any stages { stage("Get code from repo") { steps{ withCredentials([gitUsernamePassword(credentialsId: 'jenkinsgiteausername', gitToolName: 'git')]) { // git url: "https://gitea.dev.osnawiki.de/ds/test" , branch: "main" git url: "${repo}" , branch: "${Branch}" } } } stage("Build Docker image") { steps { script { //def customImage = docker.build("my-image:${env.BUILD_ID}") def imageName = "registry.dev.osnawiki.de/${env.Repo.replace('https://gitea.dev.osnawiki.de/','').replace('/','-').replaceAll('-','')}:${env.Branch.toLowerCase()}-${env.BUILD_NUMBER}" imageName = imageName.replace('--','-') echo "Baue Image Branch ${imageName}" // customImage = docker.build(imageName) } } } stage("Push images") { steps { script { withDockerRegistry(credentialsId: 'registrycredentials', url: "https://registry.dev.osnawiki.de") { // customImage.push("latest") } } } } } }