From 0a328cdc2acccfd9b82bc798a6fee31ef1540fe3 Mon Sep 17 00:00:00 2001 From: Shahzad Chaudhry Date: Sun, 10 Sep 2017 01:56:48 +0100 Subject: [PATCH 1/6] Add files via upload Added Jenkinsfile --- Jenkinsfile | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..8b828d58b --- /dev/null +++ b/Jenkinsfile @@ -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) + } + } +} From b8696bc4869ecbc3bd4f973a94d901148800faee Mon Sep 17 00:00:00 2001 From: Shahzad Chaudhry Date: Wed, 13 Sep 2017 15:24:36 +0100 Subject: [PATCH 2/6] Experimenting --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8b828d58b..fb10f837a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,12 +12,12 @@ pipeline { stages { stage("build") { steps { - sh 'mvn -Dmaven.test.failure.ignore=true --settings /var/jenkins_home/settings-docker.xml clean package' + sh 'mvn -Dmaven.test.failure.ignore=true clean package' } } stage('Quality Gates') { steps { - sh 'mvn --settings /var/jenkins_home/settings-docker.xml sonar:sonar' + sh 'mvn sonar:sonar' } } stage('Deploy - Dev') { From c60e13f45d6f97a56a9ebe56048c63f4ca79a02f Mon Sep 17 00:00:00 2001 From: "Shahzad A. Chaudhry" Date: Thu, 14 Sep 2017 21:15:55 +0100 Subject: [PATCH 3/6] Revert "Experimenting" This reverts commit b8696bc4869ecbc3bd4f973a94d901148800faee. --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fb10f837a..8b828d58b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,12 +12,12 @@ pipeline { stages { stage("build") { steps { - sh 'mvn -Dmaven.test.failure.ignore=true clean package' + sh 'mvn -Dmaven.test.failure.ignore=true --settings /var/jenkins_home/settings-docker.xml clean package' } } stage('Quality Gates') { steps { - sh 'mvn sonar:sonar' + sh 'mvn --settings /var/jenkins_home/settings-docker.xml sonar:sonar' } } stage('Deploy - Dev') { From beada8ac6a5e0db45eef1039826d0dfb506170ad Mon Sep 17 00:00:00 2001 From: "Shahzad A. Chaudhry" Date: Sat, 23 Sep 2017 03:10:35 +0100 Subject: [PATCH 4/6] Created an attachable network which was needed for maven in petclinic repo to connect to ci services internally --- Jenkinsfile | 137 +++++++++++++++++++++++++++------------------------- 1 file changed, 71 insertions(+), 66 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8b828d58b..214f9300f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,67 +1,72 @@ -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/**/*" +pipeline { + agent { + docker{ + image 'maven:alpine' + args '--network=ci_attachable' + } + } + 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) - } - } -} + archiveArtifacts(artifacts: 'target/*.jar', fingerprint: true, onlyIfSuccessful: true, defaultExcludes: true) + } + } +} From 728b55f485e0ef19028f7b289e39ac7367bad5b2 Mon Sep 17 00:00:00 2001 From: "Shahzad A. Chaudhry" Date: Thu, 28 Sep 2017 00:19:38 +0100 Subject: [PATCH 5/6] volume mount configuration change as jenkins container was refusing to start on Docker for AWS --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 214f9300f..a89ceb252 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,12 +17,12 @@ pipeline { stages { stage("build") { steps { - sh 'mvn -Dmaven.test.failure.ignore=true --settings /var/jenkins_home/settings-docker.xml clean package' + sh 'mvn -Dmaven.test.failure.ignore=true --settings /maven/settings-docker.xml clean package' } } stage('Quality Gates') { steps { - sh 'mvn --settings /var/jenkins_home/settings-docker.xml sonar:sonar' + sh 'mvn --settings /maven/settings-docker.xml sonar:sonar' } } stage('Deploy - Dev') { From ea8ec66a27579627bc321f8bcbf132c139b54015 Mon Sep 17 00:00:00 2001 From: "Shahzad A. Chaudhry" Date: Tue, 10 Oct 2017 22:57:57 +0100 Subject: [PATCH 6/6] pull request to demo jenkins blue occean --- pom.xml | 27 --------------------------- readme.md | 6 ++---- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index f64e6d122..dfd67eaac 100644 --- a/pom.xml +++ b/pom.xml @@ -6,34 +6,24 @@ org.springframework.samples spring-petclinic 1.5.1 - org.springframework.boot spring-boot-starter-parent 1.5.4.RELEASE petclinic - - - 1.8 UTF-8 UTF-8 - - 3.3.6 1.11.4 2.2.4 1.8.0 3.0.6.RELEASE - 2.7 - - - org.springframework.boot spring-boot-starter-actuator @@ -65,8 +55,6 @@ spring-boot-starter-test test - - org.hsqldb hsqldb @@ -77,8 +65,6 @@ mysql-connector-java runtime - - javax.cache cache-api @@ -87,8 +73,6 @@ org.ehcache ehcache - - org.webjars webjars-locator @@ -108,15 +92,12 @@ bootstrap ${webjars-bootstrap.version} - - org.springframework.boot spring-boot-devtools runtime - @@ -124,8 +105,6 @@ spring-boot-maven-plugin - build-info @@ -156,9 +135,6 @@ - - pl.project13.maven git-commit-id-plugin @@ -178,7 +154,6 @@ false - ro.isdc.wro4j wro4j-maven-plugin @@ -210,7 +185,6 @@ - org.codehaus.mojo cobertura-maven-plugin @@ -224,5 +198,4 @@ - diff --git a/readme.md b/readme.md index ac30d6392..c308764c8 100644 --- a/readme.md +++ b/readme.md @@ -10,6 +10,8 @@ ./mvnw spring-boot:run ``` + + You can then access petclinic here: http://localhost:8080/ petclinic-screenshot @@ -99,7 +101,3 @@ Here is a list of them: The [issue tracker](https://github.com/spring-projects/spring-petclinic/issues) is the preferred channel for bug reports, features requests and submitting pull requests. For pull requests, editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at . - - - -