mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 14:05:50 +00:00
Add files via upload
Added Jenkinsfile
This commit is contained in:
parent
101c9dc690
commit
0a328cdc2a
1 changed files with 67 additions and 0 deletions
67
Jenkinsfile
vendored
Normal file
67
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
pipeline {
|
||||||
|
agent { docker 'maven:alpine' }
|
||||||
|
options {
|
||||||
|
gitLabConnection('gitlab')
|
||||||
|
buildDiscarder(logRotator(numToKeepStr: '5'))
|
||||||
|
timestamps()
|
||||||
|
}
|
||||||
|
triggers {
|
||||||
|
gitlab(triggerOnPush: true, triggerOnMergeRequest: true, branchFilterType: 'All')
|
||||||
|
pollSCM '@hourly'
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage("build") {
|
||||||
|
steps {
|
||||||
|
sh 'mvn -Dmaven.test.failure.ignore=true --settings /var/jenkins_home/settings-docker.xml clean package'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Quality Gates') {
|
||||||
|
steps {
|
||||||
|
sh 'mvn --settings /var/jenkins_home/settings-docker.xml sonar:sonar'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy - Dev') {
|
||||||
|
steps {
|
||||||
|
sh 'echo deploying to dev...'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Selenium Test') {
|
||||||
|
steps {
|
||||||
|
parallel (
|
||||||
|
"Firefox" : {
|
||||||
|
sh "echo testing FFX"
|
||||||
|
sh "echo more steps"
|
||||||
|
},
|
||||||
|
"Chrome" : {
|
||||||
|
sh "echo testing Chrome"
|
||||||
|
sh "echo more steps"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy - Staging') {
|
||||||
|
steps {
|
||||||
|
sh 'echo deploying to staging...'
|
||||||
|
sh 'echo smoke tests...'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy - Production') {
|
||||||
|
steps {
|
||||||
|
sh 'echo deploying to production...'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
failure {
|
||||||
|
updateGitlabCommitStatus name: 'build', state: 'failed'
|
||||||
|
}
|
||||||
|
success {
|
||||||
|
updateGitlabCommitStatus name: 'build', state: 'success'
|
||||||
|
}
|
||||||
|
always {
|
||||||
|
archive "target/**/*"
|
||||||
|
junit(allowEmptyResults: true, testResults: 'target/surefire-reports/*.xml')
|
||||||
|
archiveArtifacts(artifacts: 'target/*.jar', fingerprint: true, onlyIfSuccessful: true, defaultExcludes: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue