backend/Jenkinsfile
2025-06-05 21:58:13 +02:00

38 lines
1.1 KiB
Groovy

pipeline {
agent any
stages {
stage('Set Image Name') {
steps {
script {
env.IMAGE = "harbor.dinauer.dev/kubooboo/backend:${env.BUILD_NUMBER}";
}
}
}
stage('Build Quarkus application') {
steps {
script {
sh 'mvn clean install'
}
}
}
stage('Build Docker Image') {
steps {
script {
sh "docker build --no-cache -t ${env.IMAGE} ."
}
}
}
stage('Push Image to Docker Hub') {
steps {
script {
withCredentials([usernamePassword(credentialsId: 'harbor', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'echo ${PASSWORD} | docker login harbor.dinauer.dev -u ${USERNAME} --password-stdin'
sh "docker push ${env.IMAGE}"
sh "docker logout"
}
}
}
}
}
}