mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:25:50 +00:00
jenmkinsfile
This commit is contained in:
parent
d8d3336d80
commit
fa42c8b1e4
1 changed files with 2 additions and 8 deletions
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
|
@ -2,24 +2,21 @@ pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
tools {
|
tools {
|
||||||
// You can still let Jenkins manage Maven, if you want
|
|
||||||
maven 'maven-3'
|
maven 'maven-3'
|
||||||
}
|
}
|
||||||
|
|
||||||
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}"
|
||||||
// Adjust URL if needed (HTTP vs. HTTPS)
|
|
||||||
ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory"
|
ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
stage('Download JFrog CLI') {
|
stage('Download JFrog CLI') {
|
||||||
steps {
|
steps {
|
||||||
// Download the CLI to "jf"
|
// Download a specific ARM64 version of the jf binary
|
||||||
sh '''
|
sh '''
|
||||||
curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/latest/jfrog-cli-linux-arm64/jf -o jf
|
curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.42.2/jfrog-cli-linux-arm64/jf -o jf
|
||||||
chmod +x jf
|
chmod +x jf
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
@ -28,7 +25,6 @@ pipeline {
|
||||||
stage('Configure JFrog CLI') {
|
stage('Configure JFrog CLI') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
|
withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
|
||||||
// Add the config called "petclinic"
|
|
||||||
sh '''
|
sh '''
|
||||||
./jf c add petclinic \
|
./jf c add petclinic \
|
||||||
--url=${ARTIFACTORY_URL} \
|
--url=${ARTIFACTORY_URL} \
|
||||||
|
@ -50,7 +46,6 @@ pipeline {
|
||||||
stage('Build Maven') {
|
stage('Build Maven') {
|
||||||
steps {
|
steps {
|
||||||
sh 'chmod +x mvnw'
|
sh 'chmod +x mvnw'
|
||||||
// Configure Maven's Artifactory resolver/deployer
|
|
||||||
sh '''
|
sh '''
|
||||||
./jf mvnc --global \
|
./jf mvnc --global \
|
||||||
--repo-resolve-releases=petclinic-maven-dev-virtual \
|
--repo-resolve-releases=petclinic-maven-dev-virtual \
|
||||||
|
@ -58,7 +53,6 @@ pipeline {
|
||||||
--repo-deploy-releases=petclinic-maven-dev-local \
|
--repo-deploy-releases=petclinic-maven-dev-local \
|
||||||
--repo-deploy-snapshots=petclinic-maven-dev-local
|
--repo-deploy-snapshots=petclinic-maven-dev-local
|
||||||
'''
|
'''
|
||||||
// Run the actual build & deploy
|
|
||||||
sh './jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true'
|
sh './jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue