mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-29 14:49:38 +00:00
jenkinsfile
This commit is contained in:
parent
c02878d736
commit
a0ac8e079f
1 changed files with 12 additions and 18 deletions
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
|
@ -1,41 +1,35 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
tools {
|
||||||
|
jfrog 'jfrog-cli'
|
||||||
|
}
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
JFROG_CLI_BUILD_NAME = "spring-petclinic"
|
JFROG_CLI_BUILD_NAME = "spring-petclinic"
|
||||||
JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}"
|
JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Setup JFrog CLI') {
|
stage('Setup') {
|
||||||
steps {
|
steps {
|
||||||
jf "rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local --interactive=false"
|
jf 'c show'
|
||||||
|
jf 'rt ping'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Checkout') {
|
stage('Build Maven') {
|
||||||
steps {
|
|
||||||
git branch: 'main', url: 'https://github.com/JesseHouldsworth/spring-petclinic.git'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build with Maven') {
|
|
||||||
steps {
|
steps {
|
||||||
sh 'chmod +x mvnw'
|
sh 'chmod +x mvnw'
|
||||||
jf "mvnc --global --repo-resolve-releases=libs-release-local --repo-resolve-snapshots=libs-snapshot-local"
|
jf "mvnc --global --repo-resolve-releases=libs-release-local --repo-resolve-snapshots=libs-snapshot-local"
|
||||||
jf "mvn clean install -DskipTests=true -Denforcer.skip=true"
|
jf "mvn clean install -DskipTests=true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build Docker Image') {
|
stage('Docker') {
|
||||||
steps {
|
steps {
|
||||||
sh "docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} ."
|
sh "docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID ."
|
||||||
}
|
jf "docker-push localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID petclinic-docker-dev-local"
|
||||||
}
|
|
||||||
|
|
||||||
stage('Push Docker Image') {
|
|
||||||
steps {
|
|
||||||
jf "docker-push localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} petclinic-docker-dev-local"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue