This commit is contained in:
Shahzad Chaudhry 2017-10-10 21:59:12 +00:00 committed by GitHub
commit 50e8184eaa
3 changed files with 74 additions and 31 deletions

72
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,72 @@
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 /maven/settings-docker.xml clean package'
}
}
stage('Quality Gates') {
steps {
sh 'mvn --settings /maven/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)
}
}
}

27
pom.xml
View file

@ -6,34 +6,24 @@
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic</artifactId>
<version>1.5.1</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
</parent>
<name>petclinic</name>
<properties>
<!-- Generic properties -->
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Web dependencies -->
<webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
<webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
<webjars-jquery.version>2.2.4</webjars-jquery.version>
<wro4j.version>1.8.0</wro4j.version>
<thymeleaf.version>3.0.6.RELEASE</thymeleaf.version>
<cobertura.version>2.7</cobertura.version>
</properties>
<dependencies>
<!-- Spring and Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
@ -65,8 +55,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Databases - Uses HSQL by default -->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
@ -77,8 +65,6 @@
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!-- caching -->
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
@ -87,8 +73,6 @@
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
<!-- webjars -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
@ -108,15 +92,12 @@
<artifactId>bootstrap</artifactId>
<version>${webjars-bootstrap.version}</version>
</dependency>
<!-- end of webjars -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@ -124,8 +105,6 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<!-- Spring Boot Actuator displays build-related information
if a META-INF/build-info.properties file is present -->
<goals>
<goal>build-info</goal>
</goals>
@ -156,9 +135,6 @@
</execution>
</executions>
</plugin>
<!-- Spring Boot Actuator displays build-related information if a git.properties
file is present at the classpath -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
@ -178,7 +154,6 @@
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
</plugin>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
@ -210,7 +185,6 @@
</build>
<reporting>
<plugins>
<!-- integrate maven-cobertura-plugin to project site -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
@ -224,5 +198,4 @@
</plugin>
</plugins>
</reporting>
</project>

View file

@ -10,6 +10,8 @@
./mvnw spring-boot:run
```
You can then access petclinic here: http://localhost:8080/
<img width="1042" alt="petclinic-screenshot" src="https://cloud.githubusercontent.com/assets/838318/19727082/2aee6d6c-9b8e-11e6-81fe-e889a5ddfded.png">
@ -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 <http://editorconfig.org>.