spring-petclinic/Jenkinsfile

42 lines
599 B
Text
Raw Normal View History

2025-02-04 10:20:36 +00:00
pipeline {
agent any
2025-02-04 11:56:42 +00:00
environment {
imageName = "spring-pet-clinic"
registryCredentials = "nexus-credentials"
registry = "https://localhost:9081"
dockerImage = ''
}
2025-02-04 10:20:36 +00:00
tools {
maven 'm3'
}
2025-02-04 11:56:42 +00:00
2025-02-04 10:20:36 +00:00
stages {
2025-02-04 11:56:42 +00:00
stage ('Docker build') {
script {
dockerImage = docker.build imageName
}
}
2025-02-04 10:20:36 +00:00
stage ('Build') {
steps {
2025-02-04 10:26:12 +00:00
sh './mvnw -B -DskipTests clean package'
2025-02-04 10:20:36 +00:00
}
}
stage ('Test') {
steps {
2025-02-04 10:26:12 +00:00
sh './mvnw test'
2025-02-04 10:20:36 +00:00
}
}
stage ('Deploy') {
steps {
2025-02-04 10:44:41 +00:00
sh 'echo "hello $USER"'
2025-02-04 10:20:36 +00:00
}
}
2025-02-04 10:27:40 +00:00
}
2025-02-04 10:20:36 +00:00
}