spring-petclinic/Jenkinsfile
Jesse Houldsworth c02878d736 jenkinsfile
2025-03-25 13:04:57 -07:00

50 lines
1.2 KiB
Groovy

pipeline {
agent any
environment {
JFROG_CLI_BUILD_NAME = "spring-petclinic"
JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}"
}
stages {
stage('Setup JFrog CLI') {
steps {
jf "rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local --interactive=false"
}
}
stage('Checkout') {
steps {
git branch: 'main', url: 'https://github.com/JesseHouldsworth/spring-petclinic.git'
}
}
stage('Build with Maven') {
steps {
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"
}
}
stage('Build Docker Image') {
steps {
sh "docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} ."
}
}
stage('Push Docker Image') {
steps {
jf "docker-push localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} petclinic-docker-dev-local"
}
}
stage('Publish Build Info') {
steps {
jf "rt build-collect-env"
jf "rt build-add-git"
jf "rt build-publish"
}
}
}
}