From 183aba0539bb09c99bb490da21d5ee04b8409e20 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 31 Dec 2016 11:28:38 -0600 Subject: [PATCH 01/72] Applied fix for vet cache issue. --- .../samples/petclinic/system/CacheConfig.java | 28 ++++++++++++++++++- .../samples/petclinic/vet/VetRepository.java | 8 +++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java b/src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java index 8798bfb50..9aded41b6 100755 --- a/src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java +++ b/src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java @@ -1,6 +1,18 @@ package org.springframework.samples.petclinic.system; +import java.util.concurrent.TimeUnit; + +import org.ehcache.config.CacheConfiguration; +import org.ehcache.config.builders.CacheConfigurationBuilder; +import org.ehcache.config.builders.ResourcePoolsBuilder; +import org.ehcache.config.units.EntryUnit; +import org.ehcache.expiry.Duration; +import org.ehcache.expiry.Expirations; +import org.ehcache.jsr107.Eh107Configuration; + +import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @@ -11,4 +23,18 @@ import org.springframework.context.annotation.Profile; @EnableCaching @Profile("production") class CacheConfig { -} + + @Bean + public JCacheManagerCustomizer cacheManagerCustomizer() { + return cacheManager -> { + CacheConfiguration config = CacheConfigurationBuilder + .newCacheConfigurationBuilder(Object.class, Object.class, + ResourcePoolsBuilder.newResourcePoolsBuilder() + .heap(100, EntryUnit.ENTRIES)) + .withExpiry(Expirations.timeToLiveExpiration(Duration.of(60, TimeUnit.SECONDS))) + .build(); + cacheManager.createCache("vets", Eh107Configuration.fromEhcacheCacheConfiguration(config)); + }; + } + +} \ No newline at end of file diff --git a/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java b/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java index 20863ce76..4451f717c 100644 --- a/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/vet/VetRepository.java @@ -17,7 +17,8 @@ package org.springframework.samples.petclinic.vet; import java.util.Collection; -import org.springframework.cache.annotation.Cacheable; +import javax.cache.annotation.CacheResult; + import org.springframework.dao.DataAccessException; import org.springframework.data.repository.Repository; import org.springframework.transaction.annotation.Transactional; @@ -39,8 +40,7 @@ public interface VetRepository extends Repository { * @return a Collection of Vets */ @Transactional(readOnly = true) - @Cacheable("vets") + @CacheResult(cacheName = "vets") Collection findAll() throws DataAccessException; - -} +} \ No newline at end of file From 4564521ca34973037b5f574e2d750269116e5c79 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 8 Jan 2017 10:49:00 -0600 Subject: [PATCH 02/72] Added a trivial change to demonstrate Github's pull requests. --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 74824e378..c01430929 100644 --- a/readme.md +++ b/readme.md @@ -101,5 +101,7 @@ The [issue tracker](https://github.com/spring-projects/spring-petclinic/issues) 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 . +# Experimentation +This is a trivial change to demonstrate the functionality of Github's pull request capabilities. From 51e6a64a15ef911903a3ffdfd3c38b2e8c62ebb4 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 2 Feb 2017 16:55:00 -0600 Subject: [PATCH 03/72] Added POM file changes for Nexus. --- pom.xml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pom.xml b/pom.xml index e842808d8..c6f265f68 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,25 @@ 2.7 + + + + nexus + http://localhost:8081/repository/maven-public/ + + + + + nexus-local + http://localhost:8081/repository/maven-snapshots + + + nexus-local + http://localhost:8081/repository/maven-releases + + + @@ -207,6 +225,16 @@ + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + false + + + From f09c20793c7affc5bf2daab05d380b0bc473a045 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 4 Feb 2017 10:59:04 -0600 Subject: [PATCH 04/72] Updated the sonar properties. --- sonar-project.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index d84ed7c2d..6485f0875 100755 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,7 +1,7 @@ # Required metadata -sonar.projectKey=java-sonar-runner-simple -sonar.projectName=Simple Java project analyzed with the SonarQube Runner -sonar.projectVersion=1.0 +sonar.projectKey=spring-petclinic +sonar.projectName=Spring Pet Clinic +sonar.projectVersion=1.4.2 # Comma-separated paths to directories with sources (required) sonar.sources=src From 12ecbc5c0f3fe271c2e589939262afec3f95f495 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 5 Feb 2017 08:17:45 -0600 Subject: [PATCH 05/72] Added a new Spock test file. Updated the POM file to suport Spock. --- pom.xml | 27 +++++++++ .../model/ValidatorSpockTests.groovy | 55 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 src/test/groovy/org/springframework/samples/petclinic/model/ValidatorSpockTests.groovy diff --git a/pom.xml b/pom.xml index c6f265f68..8e79d2870 100644 --- a/pom.xml +++ b/pom.xml @@ -135,6 +135,20 @@ spring-boot-devtools runtime + + + org.spockframework + spock-core + 1.1-groovy-2.4-rc-3 + test + + + + org.codehaus.groovy + groovy-all + 2.4.7 + test + @@ -235,6 +249,19 @@ + + org.codehaus.gmavenplus + gmavenplus-plugin + 1.5 + + + + compile + testCompile + + + + diff --git a/src/test/groovy/org/springframework/samples/petclinic/model/ValidatorSpockTests.groovy b/src/test/groovy/org/springframework/samples/petclinic/model/ValidatorSpockTests.groovy new file mode 100644 index 000000000..d8c988716 --- /dev/null +++ b/src/test/groovy/org/springframework/samples/petclinic/model/ValidatorSpockTests.groovy @@ -0,0 +1,55 @@ +package org.springframework.samples.petclinic.model; + +//import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Locale; +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validator; + +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; + +import spock.lang.Specification; + +/** + * @author Chris Jones + * Simple tests adapted to use the Spock acceptance test framework. + */ +public class ValidatorSpockTests extends Specification { + + private Validator createValidator() { + LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean(); + localValidatorFactoryBean.afterPropertiesSet(); + return localValidatorFactoryBean; + } + + // 1. validate against blank first name + def "first name cannot be empty"() { + setup: + def person = new Person(); + def validator = createValidator(); + + when: + person.setFirstName("") + person.setLastName("smith") + Set> constraintViolations = validator.validate(person); + + then: + constraintViolations.size() == 1; + ConstraintViolation violation = constraintViolations.iterator().next(); + violation.getPropertyPath().toString().equals("firstName"); + violation.getMessage().equals("may not be empty"); + } + + // 2. TODO: validate against null first name. + + // 3. TODO: validate a against a valid first name (non-empty, non-null value). + + // 4. TODO: validate against empty last name + + // 5. TODO: validate against null last name + + // 6. TODO: validate a against a valid last name (non-empty, non-null value). +} From 0ec011a41beca53c966946ec0a1867977d152372 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 18 Feb 2017 15:15:51 -0600 Subject: [PATCH 06/72] Removed dependency on Nexus for Heroku. --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 8e79d2870..f8b60b266 100644 --- a/pom.xml +++ b/pom.xml @@ -34,12 +34,14 @@ + From 9d59e4649de4967575a98e33310ac685407e519a Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 18 Feb 2017 15:19:31 -0600 Subject: [PATCH 07/72] Added dotGitDirectory element to git-commit-id-plugin for Heroku. --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f8b60b266..02ee5f397 100644 --- a/pom.xml +++ b/pom.xml @@ -209,8 +209,8 @@ true yyyy-MM-dd'T'HH:mm:ssZ true - ${project.build.outputDirectory}/git.properties - + ${project.build.outputDirectory}/git.properties + ${project.basedir}/../.git From 6021120d63b59717ab5b27c2ce55e67012a5d747 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 18 Feb 2017 15:21:28 -0600 Subject: [PATCH 08/72] Updated the dotGitDirectory. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 02ee5f397..f2a5e0340 100644 --- a/pom.xml +++ b/pom.xml @@ -210,7 +210,7 @@ yyyy-MM-dd'T'HH:mm:ssZ true ${project.build.outputDirectory}/git.properties - ${project.basedir}/../.git + ${project.basedir}/.git From 79f7d1d41c60d25612ec84617b381ebd87eb3415 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 18 Feb 2017 15:37:34 -0600 Subject: [PATCH 09/72] Updated version of git-commit-id-plugin to latest. --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index f2a5e0340..8df9f6be2 100644 --- a/pom.xml +++ b/pom.xml @@ -198,6 +198,7 @@ pl.project13.maven git-commit-id-plugin + 2.2.1 From 6540184aeec36ccd14bc087514afc0fa98a68bff Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 18 Feb 2017 16:00:06 -0600 Subject: [PATCH 10/72] Updated pom based on practices defined by Heroku's user guide. --- pom.xml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8df9f6be2..104bdff9e 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,6 @@ http://localhost:8081/repository/maven-public/ - --> @@ -53,6 +52,7 @@ http://localhost:8081/repository/maven-releases + --> @@ -198,7 +198,9 @@ pl.project13.maven git-commit-id-plugin + @@ -265,7 +267,20 @@ - + + + org.apache.maven.plugins + maven-dependency-plugin + 2.4 + + + copy-dependencies + package + copy-dependencies + + + + From 2fedeedcf9c5c05140dd43c2b2de6baa4a84edc7 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 18 Feb 2017 16:04:44 -0600 Subject: [PATCH 11/72] Trying to remove the offending git-commit-id-plugin. --- pom.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 104bdff9e..c150524fb 100644 --- a/pom.xml +++ b/pom.xml @@ -195,12 +195,10 @@ + @@ -216,6 +214,7 @@ ${project.basedir}/.git + --> ro.isdc.wro4j From 4abbbbee43d99a1444d8051d1e44b92fb2c23707 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Fri, 3 Mar 2017 14:50:34 -0600 Subject: [PATCH 12/72] Removed references to cobertura since it isn't currently supported by SonarQube 6.2. Replaced with references to JaCoCo. Moved certain properties into the POM file since they were not being picked up correctly from the properties file. Made the project multi-language rather than just Java. Need to update the lab instructions to bring in the CSS plugins, etc. --- pom.xml | 72 +++++++++++++++++++++++----------------- sonar-project.properties | 8 +---- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/pom.xml b/pom.xml index c150524fb..20f18f087 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,6 @@ petclinic - 1.8 UTF-8 @@ -30,8 +29,15 @@ 3.0.2.RELEASE 2.0.4 + + + + http://sonarqube.kcura.corp/ + pom.xml + src/main + target/coverage-reports/jacoco-unit.exec - + + --> ro.isdc.wro4j @@ -279,23 +306,6 @@ - - - - - - - org.codehaus.mojo - cobertura-maven-plugin - ${cobertura.version} - - - html - - - - - - + diff --git a/sonar-project.properties b/sonar-project.properties index 6485f0875..fb1c2cbf5 100755 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,11 +3,5 @@ sonar.projectKey=spring-petclinic sonar.projectName=Spring Pet Clinic sonar.projectVersion=1.4.2 -# Comma-separated paths to directories with sources (required) -sonar.sources=src - -# Language -sonar.language=java - # Encoding of the source files -sonar.sourceEncoding=UTF-8 \ No newline at end of file +sonar.sourceEncoding=UTF-8 From edf49b5638e5219385af8846215f2f68e50a0af2 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 11 Mar 2017 11:22:12 -0600 Subject: [PATCH 13/72] Added a vagrantfile and corresponding bootstrap. --- .gitignore | 1 + Vagrantfile | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ bootstrap.sh | 22 +++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 Vagrantfile create mode 100644 bootstrap.sh diff --git a/.gitignore b/.gitignore index b00af803d..2a98a2124 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ target/* *.iml /target _site/ +.vagrant/ diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..08db68b26 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,75 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure("2") do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search. + config.vm.box = "centos/7" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + config.vm.network "forwarded_port", guest: 8080, host: 8484 + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + # config.vm.network "private_network", ip: "192.168.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.provision :shell, path: "bootstrap.sh" + config.vm.provision :file, source: "target/spring-petclinic-1.4.2.jar", destination: "/tmp/spring-petclinic-1.4.2.jar", run: "always" + config.vm.provision :shell, inline: "java -jar /tmp/spring-petclinic-1.4.2.jar &", run: "always" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + # config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # + # # Customize the amount of memory on the VM: + # vb.memory = "1024" + # end + # + # View the documentation for the provider you are using for more + # information on available options. + + # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies + # such as FTP and Heroku are also available. See the documentation at + # https://docs.vagrantup.com/v2/push/atlas.html for more information. + # config.push.define "atlas" do |push| + # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" + # end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # apt-get update + # apt-get install -y apache2 + # SHELL +end diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100644 index 000000000..ff9a255fc --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# update all existing packages +sudo yum -y update + +# install wget and dos2unix +sudo yum -y install wget +sudo yum -y install dos2unix + +# download java +sudo wget --no-cookies \ +--no-check-certificate \ +--header "Cookie: oraclelicense=accept-securebackup-cookie" \ +"http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.rpm" \ +-O /tmp/jdk-8-linux-x64.rpm + +# install java +sudo yum -y install /tmp/jdk-8-linux-x64.rpm +sudo rm /tmp/jdk-8-linux-x64.rpm + +# run the application +#java -jar /tmp/spring-petclinic-1.4.2.jar & \ No newline at end of file From 1d066df8a3449bf0a7ec9b8f6b6936cb68ee9ea9 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 29 Mar 2017 13:25:32 -0500 Subject: [PATCH 14/72] Updated POM to include additional properties. Removed references to cobertura since it isn't supported by SonarQube 6.x. Added new properties to support the checking of branches. --- pom.xml | 106 +++++++++++++++++++-------------------- sonar-project.properties | 7 --- 2 files changed, 52 insertions(+), 61 deletions(-) delete mode 100755 sonar-project.properties diff --git a/pom.xml b/pom.xml index 20f18f087..9c08847d6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,13 +6,13 @@ org.springframework.samples spring-petclinic 1.4.2 + Spring Pet Clinic org.springframework.boot spring-boot-starter-parent 1.4.2.RELEASE - petclinic @@ -29,15 +29,11 @@ 3.0.2.RELEASE 2.0.4 - - - http://sonarqube.kcura.corp/ - pom.xml - src/main - target/coverage-reports/jacoco-unit.exec + target/surefire-reports + master + src/main/java,src/main/less,src/main/resources,src/main/wro + UTF-8 + + scm:git:https://github.com/Blackhound/spring-petclinic + scm:git:https://github.com/Blackhound/spring-petclinic + https://localhost:8080 + + org.springframework.boot spring-boot-starter-actuator - org.springframework.boot spring-boot-starter-cache - org.springframework.boot spring-boot-starter-data-jpa - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-thymeleaf - org.codehaus.groovy - groovy + org.codehaus.groovy + groovy - org.springframework.boot spring-boot-starter-test @@ -105,7 +102,6 @@ hsqldb runtime - mysql mysql-connector-java @@ -117,7 +113,6 @@ javax.cache cache-api - org.ehcache ehcache @@ -128,19 +123,16 @@ org.webjars webjars-locator - org.webjars jquery ${webjars-jquery.version} - org.webjars jquery-ui ${webjars-jquery-ui.version} - org.webjars bootstrap @@ -162,22 +154,21 @@ - org.codehaus.groovy - groovy-all - 2.4.7 - test - - - - org.sonarsource.java - sonar-jacoco-listeners - 3.8 + org.codehaus.groovy + groovy-all + 2.4.7 test - + + + org.apache.maven.plugins + maven-scm-plugin + 1.9.5 + + org.springframework.boot spring-boot-maven-plugin @@ -201,28 +192,15 @@ - org.jacoco - jacoco-maven-plugin - 0.7.9 + org.apache.maven.plugins + maven-surefire-plugin - ${basedir}/target/coverage-reports/jacoco-unit.exec - ${basedir}/target/coverage-reports/jacoco-unit.exec + random - - - jacoco-initialize - - prepare-agent - - - - - - - pl.project13.maven git-commit-id-plugin @@ -241,7 +219,6 @@ ${project.basedir}/.git - --> ro.isdc.wro4j @@ -306,6 +283,27 @@ - + + + org.jacoco + jacoco-maven-plugin + 0.7.9 + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + package + + report + + + + + diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100755 index fb1c2cbf5..000000000 --- a/sonar-project.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Required metadata -sonar.projectKey=spring-petclinic -sonar.projectName=Spring Pet Clinic -sonar.projectVersion=1.4.2 - -# Encoding of the source files -sonar.sourceEncoding=UTF-8 From 8b2320973d50999d4113d92fda85b61b459517d3 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 17 Apr 2017 10:40:26 -0500 Subject: [PATCH 15/72] Commented out the branch specifier since it isn't really needed by default, at least not for master. --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 9c08847d6..69d52247e 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,9 @@ http://sonarqube.kcura.corp/ target/surefire-reports + src/main/java,src/main/less,src/main/resources,src/main/wro UTF-8 From ae32a274fc60f54ee16a3e76742c470ec0f5399a Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Fri, 21 Apr 2017 08:05:51 -0500 Subject: [PATCH 16/72] Commented out the git-commit-id-plugin since TeamCity was failing on the dotGitDirectory. Will troubleshoot later if needed but for now it isn't critical for my SonarQube experiments. --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 69d52247e..f06720b2c 100644 --- a/pom.xml +++ b/pom.xml @@ -203,6 +203,7 @@ + ro.isdc.wro4j From 76429ba6be84889b7c44f76aa8c07953dc48afbf Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 4 May 2017 13:42:03 -0500 Subject: [PATCH 17/72] Updated sonar URL to reference https. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f06720b2c..621431858 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 3.0.2.RELEASE 2.0.4 - http://sonarqube.kcura.corp/ + https://sonarqube.kcura.corp/ target/surefire-reports src/main/java,src/main/less,src/main/resources,src/main/wro + --> UTF-8 diff --git a/sonar-project.properties b/sonar-project.properties index 8e19c5e84..5e4b82983 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,7 +4,8 @@ sonar.projectName=Spring Pet Clinic sonar.projectVersion=1.4.2 # Comma-separated paths to directories with sources (required) -sonar.sources=src/main/java,src/less,src/main/resources,src/main/wro +#sonar.sources=src/main/java,src/main/less,src/main/resources,src/main/wro +sonar.sources=src/main # Language #sonar.language=java From c0ccbf3c969c7740e223fff309c978f5a8cd6f19 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 9 May 2017 08:21:29 -0500 Subject: [PATCH 20/72] Added sonar.java.binaries property to try and address a findbugs issue. --- sonar-project.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 5e4b82983..293107a95 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,4 +14,6 @@ sonar.sources=src/main sonar.sourceEncoding=UTF-8 # other stuff -sonar.host.url=http://sonarqube.kcura.corp/ \ No newline at end of file +sonar.host.url=http://sonarqube.kcura.corp/ +sonar.java.binaries=target/classes +sonar.junit.reportsPath=target/surefire-reports \ No newline at end of file From 979fa1972a6ae69850e3bb13606ce348f02597c7 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 9 May 2017 12:53:55 -0500 Subject: [PATCH 21/72] Updated the project key. --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 293107a95..63fde223d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ # Required metadata -sonar.projectKey=spring-petclinic +sonar.projectKey=org.springframework.samples:spring-petclinic sonar.projectName=Spring Pet Clinic sonar.projectVersion=1.4.2 From 552a5247a3747985c0ffbb1992db4e57f1fae9d2 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 16 Aug 2017 07:48:04 -0500 Subject: [PATCH 22/72] Added buildspec.yml for AWS CodeBuild. --- buildspec.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 buildspec.yml diff --git a/buildspec.yml b/buildspec.yml new file mode 100644 index 000000000..cb1d5be2b --- /dev/null +++ b/buildspec.yml @@ -0,0 +1,29 @@ +version: 0.2 + +#env: +# variables: +# key: "value" +# key: "value" + +phases: +# install: +# commands: +# - command +# - command +# pre_build: +# commands: +# - command +# - command + build: + commands: + - mvn clean package +# post_build: +# commands: +# - command +# - command +artifacts: + files: + - location + - location + discard-paths: yes + base-directory: location \ No newline at end of file From bd98ccbf75a7aef058990bd6b5648ed9fcdc1d4b Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 16 Aug 2017 07:57:10 -0500 Subject: [PATCH 23/72] Updated buildspec.yml to specify artifacts. --- buildspec.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index cb1d5be2b..758f317d4 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -23,7 +23,6 @@ phases: # - command artifacts: files: - - location - - location + - target/spring-petclinic-1.4.2 discard-paths: yes - base-directory: location \ No newline at end of file +# base-directory: location \ No newline at end of file From 86772a2bef0f4c5245c5bf6a4cc5fe692557df48 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 16 Aug 2017 08:09:31 -0500 Subject: [PATCH 24/72] Updated buildspec.yml to specify artifacts. --- buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index 758f317d4..8fe30669a 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -23,6 +23,6 @@ phases: # - command artifacts: files: - - target/spring-petclinic-1.4.2 + - target/spring-petclinic-1.4.2.jar discard-paths: yes # base-directory: location \ No newline at end of file From 59fc90f08b7303a4d34c02e7f078a7cf61940cf5 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 31 Aug 2017 07:24:18 -0500 Subject: [PATCH 25/72] Adding syntax error to test Splunk feedback. --- .../springframework/samples/petclinic/PetClinicApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java index 224c326c7..96fd66e69 100644 --- a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java +++ b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java @@ -29,7 +29,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; public class PetClinicApplication { public static void main(String[] args) throws Exception { - SpringApplication.run(PetClinicApplication.class, args); + SpringApplication.run(PetClinicApplication.class, args) } } From 49d729e3cde4ceb0378ca9ee750e55217bee2843 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 31 Aug 2017 07:25:37 -0500 Subject: [PATCH 26/72] Fixed previously added syntax error. --- .../springframework/samples/petclinic/PetClinicApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java index 96fd66e69..224c326c7 100644 --- a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java +++ b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java @@ -29,7 +29,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; public class PetClinicApplication { public static void main(String[] args) throws Exception { - SpringApplication.run(PetClinicApplication.class, args) + SpringApplication.run(PetClinicApplication.class, args); } } From fbaab781deedaf49ed3ba982d9f6e9ffdc69a424 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 31 Aug 2017 15:11:09 -0500 Subject: [PATCH 27/72] Added Jenkinsfile for pipelining. --- Jenkinsfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..d9cd578ca --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,19 @@ +pipeline { + environment { + } + + tools { + maven 'Maven 3.5.0' + } + + agent none + + stages { + stage('Build, Test, and Package') { + agent any + steps { + sh "mvn clean package" + } + } + } +} \ No newline at end of file From 0a6f8f7be15fa5253d9f9b0a7a8805503760510b Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 31 Aug 2017 15:14:40 -0500 Subject: [PATCH 28/72] Commented out environment settings for now. --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d9cd578ca..cec651915 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { - environment { - } + //environment { + //} tools { maven 'Maven 3.5.0' From 66c9b326465a7b1b2a6c81790cec3a4f4f2c682b Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 1 Sep 2017 13:33:57 -0500 Subject: [PATCH 29/72] Added input step for experimentation. --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index cec651915..7d639d025 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,6 +14,7 @@ pipeline { steps { sh "mvn clean package" } + input 'Sally forth?' } } } \ No newline at end of file From 4ee9ced1a9caef13b92067c1cbb478357de9652a Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 1 Sep 2017 13:35:24 -0500 Subject: [PATCH 30/72] Moved input step to the right place.. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7d639d025..555a23770 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,8 +13,8 @@ pipeline { agent any steps { sh "mvn clean package" + input 'Sally forth?' } - input 'Sally forth?' } } } \ No newline at end of file From 7852dc58b8b24cd1e98146ddf86a42c1e78d6246 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 1 Sep 2017 13:36:49 -0500 Subject: [PATCH 31/72] Moved input step to its own stage. --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 555a23770..009b53dc5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,8 +13,14 @@ pipeline { agent any steps { sh "mvn clean package" - input 'Sally forth?' } } + + stage('Approve for QA') { + agent any + steps { + input 'Sally forth?' + } + } } } \ No newline at end of file From 0aea718e5e18ac9400a3e2102010a1b74107968d Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 08:14:04 -0500 Subject: [PATCH 32/72] Adding a sample SonarQube configuration. --- Jenkinsfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 009b53dc5..fb0169e6b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,6 +16,30 @@ pipeline { } } + stage('SonarQube analysis') { + withSonarQubeEnv('SonarQube Scanner 3.0.3.778') { + sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar ' + + '-f pom.xml ' + + '-Dsonar.projectKey=com.huettermann:all:master ' + + '-Dsonar.login=$SONAR_UN ' + + '-Dsonar.password=$SONAR_PW ' + + '-Dsonar.language=java ' + + '-Dsonar.sources=. ' + + '-Dsonar.tests=. ' + + '-Dsonar.test.inclusions=**/*Test*/** ' + + '-Dsonar.exclusions=**/*Test*/**' + } + } + + stage("SonarQube Quality Gate") { + timeout(time: 1, unit: 'HOURS') { + def qg = waitForQualityGate() + if (qg.status != 'OK') { + error "Pipeline aborted due to quality gate failure: ${qg.status}" + } + } + } + stage('Approve for QA') { agent any steps { From 71c6368f9634e15828d9756bd61ad184f705380d Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 08:27:01 -0500 Subject: [PATCH 33/72] Added missing steps. --- Jenkinsfile | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fb0169e6b..0caa83946 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,28 +16,33 @@ pipeline { } } - stage('SonarQube analysis') { - withSonarQubeEnv('SonarQube Scanner 3.0.3.778') { - sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar ' + - '-f pom.xml ' + - '-Dsonar.projectKey=com.huettermann:all:master ' + - '-Dsonar.login=$SONAR_UN ' + - '-Dsonar.password=$SONAR_PW ' + - '-Dsonar.language=java ' + - '-Dsonar.sources=. ' + - '-Dsonar.tests=. ' + - '-Dsonar.test.inclusions=**/*Test*/** ' + - '-Dsonar.exclusions=**/*Test*/**' - } + stage('SonarQube analysis') { + agent any + steps { + withSonarQubeEnv('SonarQube Scanner 3.0.3.778') { + sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar ' + + '-f pom.xml ' + + '-Dsonar.projectKey=com.huettermann:all:master ' + + '-Dsonar.login=$SONAR_UN ' + + '-Dsonar.password=$SONAR_PW ' + + '-Dsonar.language=java ' + + '-Dsonar.sources=. ' + + '-Dsonar.tests=. ' + + '-Dsonar.test.inclusions=**/*Test*/** ' + + '-Dsonar.exclusions=**/*Test*/**' + } + } } - stage("SonarQube Quality Gate") { - timeout(time: 1, unit: 'HOURS') { - def qg = waitForQualityGate() - if (qg.status != 'OK') { - error "Pipeline aborted due to quality gate failure: ${qg.status}" + stage("SonarQube Quality Gate") { + steps { + timeout(time: 1, unit: 'HOURS') { + def qg = waitForQualityGate() + if (qg.status != 'OK') { + error "Pipeline aborted due to quality gate failure: ${qg.status}" + } } - } + } } stage('Approve for QA') { From b5f3e99cf4bf18771f7bfba4cdd74befefdba915 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 08:41:20 -0500 Subject: [PATCH 34/72] Temporarily commented out the wait for the analysis. --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 0caa83946..60bcb2252 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,6 +34,7 @@ pipeline { } } + /* stage("SonarQube Quality Gate") { steps { timeout(time: 1, unit: 'HOURS') { @@ -44,6 +45,7 @@ pipeline { } } } + */ stage('Approve for QA') { agent any From 1a63facf4ab2435504c9d27e8e07f40441a68ab9 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 09:28:37 -0500 Subject: [PATCH 35/72] Updated the SQ steps. --- Jenkinsfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 60bcb2252..4e9c46686 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,9 @@ pipeline { stage('SonarQube analysis') { agent any steps { - withSonarQubeEnv('SonarQube Scanner 3.0.3.778') { + // jenkins SQ token: 9ba8e3134a1cbc76910a73579a888b5e91df9717 + /* + withSonarQubeEnv('Staging') { sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar ' + '-f pom.xml ' + '-Dsonar.projectKey=com.huettermann:all:master ' + @@ -31,7 +33,12 @@ pipeline { '-Dsonar.test.inclusions=**/*Test*/** ' + '-Dsonar.exclusions=**/*Test*/**' } - } + */ + withSonarQubeEnv('Staging') { + def scannerHome = tool 'SonarQube Scanner 3.0.3.778'; + sh "${scannerHome}/bin/sonar-scanner" + } + } } /* From 768da120cc6e86aed63e20164623a6063b8e2cd4 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 10:35:08 -0500 Subject: [PATCH 36/72] Updated the SQ steps. --- Jenkinsfile | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4e9c46686..1a4cd0670 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,20 +20,19 @@ pipeline { agent any steps { // jenkins SQ token: 9ba8e3134a1cbc76910a73579a888b5e91df9717 - /* - withSonarQubeEnv('Staging') { - sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar ' + - '-f pom.xml ' + - '-Dsonar.projectKey=com.huettermann:all:master ' + - '-Dsonar.login=$SONAR_UN ' + - '-Dsonar.password=$SONAR_PW ' + - '-Dsonar.language=java ' + - '-Dsonar.sources=. ' + - '-Dsonar.tests=. ' + - '-Dsonar.test.inclusions=**/*Test*/** ' + - '-Dsonar.exclusions=**/*Test*/**' - } - */ + //withSonarQubeEnv('Staging') { + // sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar ' + + // '-f pom.xml ' + + // '-Dsonar.projectKey=com.huettermann:all:master ' + + // '-Dsonar.login=$SONAR_UN ' + + // '-Dsonar.password=$SONAR_PW ' + + // '-Dsonar.language=java ' + + // '-Dsonar.sources=. ' + + // '-Dsonar.tests=. ' + + // '-Dsonar.test.inclusions=**/*Test*/** ' + + // '-Dsonar.exclusions=**/*Test*/**' + //} + withSonarQubeEnv('Staging') { def scannerHome = tool 'SonarQube Scanner 3.0.3.778'; sh "${scannerHome}/bin/sonar-scanner" From 9ee0b657e21407feb7fd050290ed9e1b30e65c25 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 10:43:59 -0500 Subject: [PATCH 37/72] Moved some of the code into a 'script' step. --- Jenkinsfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1a4cd0670..bfa7faebd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,9 +2,9 @@ pipeline { //environment { //} - tools { - maven 'Maven 3.5.0' - } + //tools { + // maven 'Maven 3.5.0' + //} agent none @@ -33,8 +33,10 @@ pipeline { // '-Dsonar.exclusions=**/*Test*/**' //} - withSonarQubeEnv('Staging') { + script { def scannerHome = tool 'SonarQube Scanner 3.0.3.778'; + } + withSonarQubeEnv('Staging') { sh "${scannerHome}/bin/sonar-scanner" } } From 43932be6a0fbd2204f691b2d17fed8adc133df31 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 10:46:00 -0500 Subject: [PATCH 38/72] Re-added the maven tool. --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bfa7faebd..160bd5ec9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,9 +2,9 @@ pipeline { //environment { //} - //tools { - // maven 'Maven 3.5.0' - //} + tools { + maven 'Maven 3.5.0' + } agent none From 677f454573f21aedff06dc2172b2b0683feddd4e Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 10:56:47 -0500 Subject: [PATCH 39/72] Moved SQ tool lookup to environment section. --- Jenkinsfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 160bd5ec9..110dbb102 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,7 @@ pipeline { - //environment { - //} + environment { + SQ_SCANNER = tool 'SonarQube Scanner 3.0.3.778'; + } tools { maven 'Maven 3.5.0' @@ -33,11 +34,8 @@ pipeline { // '-Dsonar.exclusions=**/*Test*/**' //} - script { - def scannerHome = tool 'SonarQube Scanner 3.0.3.778'; - } withSonarQubeEnv('Staging') { - sh "${scannerHome}/bin/sonar-scanner" + sh "${SQ_SCANNER}/bin/sonar-scanner" } } } From 99e16f7c4ca1ed4b3b790f76e857ad2ee21af4fb Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 11:03:32 -0500 Subject: [PATCH 40/72] Attemping to use underscores in the tool in places of spaces. --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 110dbb102..50bc2f60c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { environment { - SQ_SCANNER = tool 'SonarQube Scanner 3.0.3.778'; + SQ_SCANNER = tool 'SonarQube_Scanner_3.0.3.778'; } tools { @@ -35,6 +35,7 @@ pipeline { //} withSonarQubeEnv('Staging') { + echo "${SQ_SCANNER}" sh "${SQ_SCANNER}/bin/sonar-scanner" } } From 60a6d745869a74c97226fe5dec3531bcf8c7f169 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 11:26:56 -0500 Subject: [PATCH 41/72] Moved the tool call back to a step since it wasn't being interpreted in the ENVIRONMENT section. --- Jenkinsfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 50bc2f60c..1f7ff004b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,6 @@ pipeline { - environment { - SQ_SCANNER = tool 'SonarQube_Scanner_3.0.3.778'; - } + //environment { + //} tools { maven 'Maven 3.5.0' @@ -33,10 +32,14 @@ pipeline { // '-Dsonar.test.inclusions=**/*Test*/** ' + // '-Dsonar.exclusions=**/*Test*/**' //} + + script { + scannerHome = tool 'SonarQube_Scanner_3.0.3.778'; + } withSonarQubeEnv('Staging') { - echo "${SQ_SCANNER}" - sh "${SQ_SCANNER}/bin/sonar-scanner" + echo "${scannerHome}" + sh "${scannerHome}/bin/sonar-scanner" } } } From 807a24d22d8812fa5e91dd3577e02bdbce80b13e Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 11:33:44 -0500 Subject: [PATCH 42/72] Removed dead code. Commented out QA approval for now. --- Jenkinsfile | 22 +++------------------- sonar-project.properties | 2 +- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1f7ff004b..b1b6e594d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,33 +6,17 @@ pipeline { maven 'Maven 3.5.0' } - agent none + agent any stages { stage('Build, Test, and Package') { - agent any steps { sh "mvn clean package" } } stage('SonarQube analysis') { - agent any steps { - // jenkins SQ token: 9ba8e3134a1cbc76910a73579a888b5e91df9717 - //withSonarQubeEnv('Staging') { - // sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar ' + - // '-f pom.xml ' + - // '-Dsonar.projectKey=com.huettermann:all:master ' + - // '-Dsonar.login=$SONAR_UN ' + - // '-Dsonar.password=$SONAR_PW ' + - // '-Dsonar.language=java ' + - // '-Dsonar.sources=. ' + - // '-Dsonar.tests=. ' + - // '-Dsonar.test.inclusions=**/*Test*/** ' + - // '-Dsonar.exclusions=**/*Test*/**' - //} - script { scannerHome = tool 'SonarQube_Scanner_3.0.3.778'; } @@ -58,9 +42,9 @@ pipeline { */ stage('Approve for QA') { - agent any steps { - input 'Sally forth?' + // input 'Sally forth?' + echo 'Pipeline done' } } } diff --git a/sonar-project.properties b/sonar-project.properties index 63fde223d..1357f9b54 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,6 +14,6 @@ sonar.sources=src/main sonar.sourceEncoding=UTF-8 # other stuff -sonar.host.url=http://sonarqube.kcura.corp/ +sonar.host.url=http://mssonarstg81.morningstar.com:9000 sonar.java.binaries=target/classes sonar.junit.reportsPath=target/surefire-reports \ No newline at end of file From 73ca495ee727b3390be4652f386bea7fa2e8b548 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 6 Sep 2017 11:49:43 -0500 Subject: [PATCH 43/72] Re-added QA approval to test quality gate stage. --- Jenkinsfile | 4 +--- pom.xml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b1b6e594d..8a31f4390 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,8 +28,7 @@ pipeline { } } - /* - stage("SonarQube Quality Gate") { + stage('SonarQube Quality Gate') { steps { timeout(time: 1, unit: 'HOURS') { def qg = waitForQualityGate() @@ -39,7 +38,6 @@ pipeline { } } } - */ stage('Approve for QA') { steps { diff --git a/pom.xml b/pom.xml index 376be77b8..e25429136 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 3.0.2.RELEASE 2.0.4 - https://sonarqube.kcura.corp/ + http://mssonarstg81.morningstar.com:9000 target/surefire-reports