mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:15:50 +00:00
jenmkinsfile
This commit is contained in:
parent
af797a30c4
commit
e0a5d2a2c5
1 changed files with 12 additions and 15 deletions
27
Jenkinsfile
vendored
27
Jenkinsfile
vendored
|
@ -9,27 +9,26 @@ pipeline {
|
|||
environment {
|
||||
JFROG_CLI_BUILD_NAME = "spring-petclinic"
|
||||
JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}"
|
||||
ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Configure JFrog CLI') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'artifactory-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
|
||||
sh '''
|
||||
jf c show petclinic || jf c add petclinic \
|
||||
--url=${ARTIFACTORY_URL} \
|
||||
--user=${ARTIFACTORY_USER} \
|
||||
--password=${ARTIFACTORY_PASSWORD} \
|
||||
withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
|
||||
sh """
|
||||
jf c add petclinic \
|
||||
--url=http://artifactory.artifactory.svc.cluster.local:8081/artifactory \
|
||||
--user=\$ARTIFACTORY_USER \
|
||||
--password=\$ARTIFACTORY_PASSWORD \
|
||||
--interactive=false
|
||||
jf use petclinic
|
||||
'''
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Validate Connection') {
|
||||
steps {
|
||||
sh 'jf c use petclinic'
|
||||
sh 'jf rt ping'
|
||||
}
|
||||
}
|
||||
|
@ -50,18 +49,16 @@ pipeline {
|
|||
|
||||
stage('Publish Build Info') {
|
||||
steps {
|
||||
sh '''
|
||||
jf rt build-collect-env
|
||||
jf rt build-add-git
|
||||
jf rt build-publish
|
||||
'''
|
||||
sh 'jf rt build-collect-env'
|
||||
sh 'jf rt build-add-git'
|
||||
sh 'jf rt build-publish'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
echo "Build complete: $JFROG_CLI_BUILD_NAME #$JFROG_CLI_BUILD_NUMBER"
|
||||
echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue