mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:25:50 +00:00
jenmkinsfile
This commit is contained in:
parent
2f3787c33a
commit
a920cc6c83
1 changed files with 22 additions and 8 deletions
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
|
@ -4,13 +4,16 @@ pipeline {
|
||||||
maven 'maven-3'
|
maven 'maven-3'
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
|
// -----------------------------
|
||||||
|
// Adjust these values as needed
|
||||||
|
// -----------------------------
|
||||||
JFROG_URL = "https://trialt0zppb.jfrog.io"
|
JFROG_URL = "https://trialt0zppb.jfrog.io"
|
||||||
JFROG_REPO_RELEASES = "petclinic-maven-dev-local"
|
JFROG_REPO_RELEASES = "petclinic-maven-dev-local"
|
||||||
JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual"
|
JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual"
|
||||||
JFROG_CREDENTIALS_ID = 'jfrog-saas'
|
JFROG_CREDENTIALS_ID = 'jfrog-saas'
|
||||||
JFROG_CLI_BUILD_NAME = "spring-petclinic"
|
JFROG_CLI_BUILD_NAME = "spring-petclinic"
|
||||||
JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}"
|
JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}"
|
||||||
JF = "${WORKSPACE}/jfrog"
|
JF = "${WORKSPACE}/jfrog" // local path to the downloaded CLI
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Download JFrog CLI') {
|
stage('Download JFrog CLI') {
|
||||||
|
@ -37,23 +40,34 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build Maven') {
|
stage('Build with Maven') {
|
||||||
steps {
|
steps {
|
||||||
sh """
|
sh """
|
||||||
${JF} mvnc --global \
|
${JF} mvnc --global \\
|
||||||
--repo-resolve-releases=${JFROG_REPO_SNAPSHOTS} \
|
--repo-resolve-releases=${JFROG_REPO_SNAPSHOTS} \\
|
||||||
--repo-resolve-snapshots=${JFROG_REPO_SNAPSHOTS} \
|
--repo-resolve-snapshots=${JFROG_REPO_SNAPSHOTS} \\
|
||||||
--repo-deploy-releases=${JFROG_REPO_RELEASES} \
|
--repo-deploy-releases=${JFROG_REPO_RELEASES} \\
|
||||||
--repo-deploy-snapshots=${JFROG_REPO_RELEASES}
|
--repo-deploy-snapshots=${JFROG_REPO_RELEASES}
|
||||||
"""
|
"""
|
||||||
sh """
|
sh """
|
||||||
${JF} mvn clean deploy -DskipTests -Dcheckstyle.skip=true \
|
${JF} mvn clean deploy -DskipTests -Dcheckstyle.skip=true \\
|
||||||
--build-name=${JFROG_CLI_BUILD_NAME} \
|
--build-name=${JFROG_CLI_BUILD_NAME} \\
|
||||||
--build-number=${JFROG_CLI_BUILD_NUMBER}
|
--build-number=${JFROG_CLI_BUILD_NUMBER}
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Xray Scan') {
|
||||||
|
steps {
|
||||||
|
// Scan the build you just deployed using Xray
|
||||||
|
// Fail the build if there's a severity of "High" or above
|
||||||
|
sh """
|
||||||
|
${JF} xray scan --build="${JFROG_CLI_BUILD_NAME}" ${JFROG_CLI_BUILD_NUMBER} \
|
||||||
|
--fail-on-severity=High
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Publish Build Info') {
|
stage('Publish Build Info') {
|
||||||
steps {
|
steps {
|
||||||
sh """
|
sh """
|
||||||
|
|
Loading…
Reference in a new issue