spring-petclinic/Jenkinsfile

51 lines
1.2 KiB
Text
Raw Normal View History

2025-03-25 19:11:30 +00:00
pipeline {
agent any
environment {
2025-03-25 19:48:00 +00:00
JFROG_CLI_BUILD_NAME = "spring-petclinic"
JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}"
2025-03-25 19:11:30 +00:00
}
stages {
2025-03-25 19:48:00 +00:00
stage('Setup JFrog CLI') {
steps {
2025-03-25 20:04:57 +00:00
jf "rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local --interactive=false"
2025-03-25 19:48:00 +00:00
}
}
stage('Checkout') {
2025-03-25 19:11:30 +00:00
steps {
2025-03-25 19:48:00 +00:00
git branch: 'main', url: 'https://github.com/JesseHouldsworth/spring-petclinic.git'
2025-03-25 19:11:30 +00:00
}
}
stage('Build with Maven') {
steps {
2025-03-25 20:04:57 +00:00
sh 'chmod +x mvnw'
jf "mvnc --global --repo-resolve-releases=libs-release-local --repo-resolve-snapshots=libs-snapshot-local"
jf "mvn clean install -DskipTests=true -Denforcer.skip=true"
2025-03-25 19:48:00 +00:00
}
}
stage('Build Docker Image') {
steps {
2025-03-25 20:04:57 +00:00
sh "docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} ."
2025-03-25 19:11:30 +00:00
}
}
2025-03-25 19:48:00 +00:00
stage('Push Docker Image') {
2025-03-25 19:11:30 +00:00
steps {
2025-03-25 20:04:57 +00:00
jf "docker-push localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} petclinic-docker-dev-local"
2025-03-25 19:11:30 +00:00
}
}
stage('Publish Build Info') {
steps {
2025-03-25 20:04:57 +00:00
jf "rt build-collect-env"
jf "rt build-add-git"
jf "rt build-publish"
2025-03-25 19:11:30 +00:00
}
}
}
}