mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:55:49 +00:00
Created an attachable network which was needed for maven in petclinic repo to connect to ci services internally
This commit is contained in:
parent
c60e13f45d
commit
beada8ac6a
1 changed files with 71 additions and 66 deletions
137
Jenkinsfile
vendored
137
Jenkinsfile
vendored
|
@ -1,67 +1,72 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { docker 'maven:alpine' }
|
agent {
|
||||||
options {
|
docker{
|
||||||
gitLabConnection('gitlab')
|
image 'maven:alpine'
|
||||||
buildDiscarder(logRotator(numToKeepStr: '5'))
|
args '--network=ci_attachable'
|
||||||
timestamps()
|
}
|
||||||
}
|
}
|
||||||
triggers {
|
options {
|
||||||
gitlab(triggerOnPush: true, triggerOnMergeRequest: true, branchFilterType: 'All')
|
gitLabConnection('gitlab')
|
||||||
pollSCM '@hourly'
|
buildDiscarder(logRotator(numToKeepStr: '5'))
|
||||||
}
|
timestamps()
|
||||||
stages {
|
}
|
||||||
stage("build") {
|
triggers {
|
||||||
steps {
|
gitlab(triggerOnPush: true, triggerOnMergeRequest: true, branchFilterType: 'All')
|
||||||
sh 'mvn -Dmaven.test.failure.ignore=true --settings /var/jenkins_home/settings-docker.xml clean package'
|
pollSCM '@hourly'
|
||||||
}
|
}
|
||||||
}
|
stages {
|
||||||
stage('Quality Gates') {
|
stage("build") {
|
||||||
steps {
|
steps {
|
||||||
sh 'mvn --settings /var/jenkins_home/settings-docker.xml sonar:sonar'
|
sh 'mvn -Dmaven.test.failure.ignore=true --settings /var/jenkins_home/settings-docker.xml clean package'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Deploy - Dev') {
|
stage('Quality Gates') {
|
||||||
steps {
|
steps {
|
||||||
sh 'echo deploying to dev...'
|
sh 'mvn --settings /var/jenkins_home/settings-docker.xml sonar:sonar'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Selenium Test') {
|
stage('Deploy - Dev') {
|
||||||
steps {
|
steps {
|
||||||
parallel (
|
sh 'echo deploying to dev...'
|
||||||
"Firefox" : {
|
}
|
||||||
sh "echo testing FFX"
|
}
|
||||||
sh "echo more steps"
|
stage('Selenium Test') {
|
||||||
},
|
steps {
|
||||||
"Chrome" : {
|
parallel (
|
||||||
sh "echo testing Chrome"
|
"Firefox" : {
|
||||||
sh "echo more steps"
|
sh "echo testing FFX"
|
||||||
}
|
sh "echo more steps"
|
||||||
)
|
},
|
||||||
}
|
"Chrome" : {
|
||||||
}
|
sh "echo testing Chrome"
|
||||||
stage('Deploy - Staging') {
|
sh "echo more steps"
|
||||||
steps {
|
}
|
||||||
sh 'echo deploying to staging...'
|
)
|
||||||
sh 'echo smoke tests...'
|
}
|
||||||
}
|
}
|
||||||
}
|
stage('Deploy - Staging') {
|
||||||
stage('Deploy - Production') {
|
steps {
|
||||||
steps {
|
sh 'echo deploying to staging...'
|
||||||
sh 'echo deploying to production...'
|
sh 'echo smoke tests...'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
stage('Deploy - Production') {
|
||||||
post {
|
steps {
|
||||||
failure {
|
sh 'echo deploying to production...'
|
||||||
updateGitlabCommitStatus name: 'build', state: 'failed'
|
}
|
||||||
}
|
}
|
||||||
success {
|
}
|
||||||
updateGitlabCommitStatus name: 'build', state: 'success'
|
post {
|
||||||
}
|
failure {
|
||||||
always {
|
updateGitlabCommitStatus name: 'build', state: 'failed'
|
||||||
archive "target/**/*"
|
}
|
||||||
|
success {
|
||||||
|
updateGitlabCommitStatus name: 'build', state: 'success'
|
||||||
|
}
|
||||||
|
always {
|
||||||
|
archive "target/**/*"
|
||||||
junit(allowEmptyResults: true, testResults: 'target/surefire-reports/*.xml')
|
junit(allowEmptyResults: true, testResults: 'target/surefire-reports/*.xml')
|
||||||
archiveArtifacts(artifacts: 'target/*.jar', fingerprint: true, onlyIfSuccessful: true, defaultExcludes: true)
|
archiveArtifacts(artifacts: 'target/*.jar', fingerprint: true, onlyIfSuccessful: true, defaultExcludes: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue