mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-26 01:15:50 +00:00
Merge 0daa3f5c4b
into 0962ed7e8f
This commit is contained in:
commit
baa0b71281
3 changed files with 105 additions and 0 deletions
80
Jenkinsfile
vendored
Normal file
80
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
pipeline {
|
||||
agent 'any'
|
||||
triggers { pollSCM '* * * * *' }
|
||||
parameters {
|
||||
choice(name: 'MAVEN_GOAL', choices: ['package', 'install', 'clean'], description: 'MAVEN_GOAL')
|
||||
}
|
||||
stages {
|
||||
stage( 'version control sysytem') {
|
||||
steps {
|
||||
git url: 'https://github.com/spring-projects/spring-petclinic.git',
|
||||
branch: 'main'
|
||||
}
|
||||
}
|
||||
stage('package') {
|
||||
steps {
|
||||
sh 'mvn package'
|
||||
}
|
||||
}
|
||||
stage('build') {
|
||||
steps {
|
||||
sh 'export PATH="/usr/lib/jvm/java-1.17.0-openjdk-amd64/bin:$PATH" && mvn package'
|
||||
}
|
||||
}
|
||||
stage('Artifactory configuration') {
|
||||
steps {
|
||||
rtServer (
|
||||
id: "ARTIFACTORY_SERVER",
|
||||
url: 'https://qtsivajijfrog.jfrog.io/artifactory',
|
||||
credentialsId: 'JFROG_TOKEN'
|
||||
)
|
||||
|
||||
rtMavenDeployer (
|
||||
id: "MAVEN_DEPLOYER",
|
||||
serverId: "ARTIFACTORY_SERVER",
|
||||
releaseRepo: 'libs-release',
|
||||
snapshotRepo: 'libs-snapshot'
|
||||
)
|
||||
|
||||
rtMavenResolver (
|
||||
id: "MAVEN_RESOLVER",
|
||||
serverId: "ARTIFACTORY_SERVER",
|
||||
releaseRepo: 'libs-release',
|
||||
snapshotRepo: 'libs-snapshot'
|
||||
)
|
||||
}
|
||||
}
|
||||
stage('packaged') {
|
||||
tools {
|
||||
jdk 'JDK_17'
|
||||
}
|
||||
steps {
|
||||
rtMavenRun (
|
||||
tool: 'MAVEN_DEFAULT',
|
||||
pom: 'pom.xml',
|
||||
goals: 'clean install',
|
||||
deployerId: "MAVEN_DEPLOYER"
|
||||
|
||||
)
|
||||
rtPublishBuildInfo (
|
||||
serverId: "ARTIFACTORY_SERVER"
|
||||
)
|
||||
//sh "mvn ${params.MAVEN_GOAL}"
|
||||
}
|
||||
}
|
||||
stage('sonar analysis') {
|
||||
steps {
|
||||
withSonarQubeEnv('SONAR_TOKEN') {
|
||||
sh 'mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=qtsonarqube_qtsonarqube-token -Dsonar.organization=qtsonarqube'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('postbuild') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: '**/target/spring-petclinic-3.0.0-SNAPSHOT.jar',
|
||||
followSymlinks: false
|
||||
junit '**/surefire-reports/TEST-*.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1
hi
Normal file
1
hi
Normal file
|
@ -0,0 +1 @@
|
|||
hi
|
24
jenkins-pipeline
Normal file
24
jenkins-pipeline
Normal file
|
@ -0,0 +1,24 @@
|
|||
pipeliene {
|
||||
agent { label 'any' }
|
||||
triggers { pollSCM '* * * * *' }
|
||||
stages {
|
||||
stage( 'version control sysytem') {
|
||||
steps {
|
||||
git url: 'https://github.com/spring-projects/spring-petclinic.git',
|
||||
branch: 'main'
|
||||
}
|
||||
}
|
||||
stage( 'package' ) {
|
||||
steps {
|
||||
sh: 'export PATH="/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH" && ./gradlew build',
|
||||
}
|
||||
}
|
||||
stage( 'post build' ) {
|
||||
steps {
|
||||
archiveArtifacts artifacts: '**/libs/spring-petclinic-3.0.0/jar'
|
||||
onlyIfSuccesful: true
|
||||
junit testresults: '**/test-results/test/TEST-*.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue