Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Pionke authored and Raphael Pionke committed Dec 13, 2018
0 parents commit 3b72390
Show file tree
Hide file tree
Showing 98 changed files with 14,329 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space

[*.{java,xml}]
indent_size = 4
trim_trailing_whitespace = true
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
target/*
.settings/*
.classpath
.project
.idea
*.iml
/target
.sts4-cache/
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
_site/
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
language: java
jdk: oraclejdk8
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch)-PetClinicApplication<spring-petclinic>",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "org.springframework.samples.petclinic.PetClinicApplication",
"projectName": "spring-petclinic",
"args": ""
},
{
"type": "java",
"name": "Debug (Attach)",
"request": "attach",
"hostName": "localhost",
"port": 0
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
19 changes: 19 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "verify",
"type": "shell",
"command": "mvn -B verify",
"group": "build"
},
{
"label": "test",
"type": "shell",
"command": "mvn -B test",
"group": "test"
}
]
}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:8-jre-slim
MAINTAINER T-Systems-MMS APM

COPY /target/spring-petclinic-2.0.0.BUILD-SNAPSHOT.jar /opt/spring-petclinic.jar
CMD ["java","-jar","/opt/spring-petclinic.jar"]
95 changes: 95 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/usr/bin/env groovy
def dockerImage

def tagMatchRules = [
[
meTypes: [
[meType: 'SERVICE']
],
tags : [
[context: 'CONTEXTLESS', key: 'Frontend']
]
], [
meTypes: [
[meType: 'SERVICE']
],
tags : [
[context: 'CONTEXTLESS', key: 'Database']
]
]
]

pipeline {
agent {
label 'docker'
}
options {
ansiColor('xterm')
timestamps()
timeout(30)
disableConcurrentBuilds()
buildDiscarder logRotator(numToKeepStr: '25')
}
triggers {
cron '@daily'
}

stages {
stage('Maven Build') {
steps {
script {
docker.image('maven:3-jdk-8-slim').inside {
sh 'mvn clean package --batch-mode'
}
}
// publishCoverage adapters: [jacocoAdapter('target/jacoco.exec')]
// findbugs pattern: '**/target/findbugsXml.xml'
// checkstyle pattern: '**/target/checkstyle-result.xml'
// junit allowEmptyResults: true, testResults: '**/target/surefire-reports/**/*.xml'
archiveArtifacts artifacts: '**/target/*.jar,**/target/*.war', fingerprint: true
}
}
stage('Docker Build') {
steps {
script {
dockerImage = docker.build('spring-petclinic:latest')
}
}
}
stage('Deploy to Staging Server') {
steps {
createDynatraceDeploymentEvent(envId: 'Dynatrace Demo Environment', tagMatchRules: tagMatchRules) {
sh 'docker-compose down'
sh 'docker-compose up -d'
}
}
}
stage('Performance Test') {
steps {
recordDynatraceSession(envId: 'Dynatrace Demo Environment', testCase: 'loadtest', tagMatchRules: tagMatchRules) {
performanceTest(readFile('performanceTest.json'))
}
perfSigDynatraceReports envId: 'Dynatrace Demo Environment', specFile: 'specfile.json', nonFunctionalFailure: 2
}
}
stage('Docker Push') {
steps {
script {
docker.withRegistry('https://hub.docker.com', 'dockerHubCredentials') {
dockerImage.push('latest')
}
}
}
}
stage('deploy to Production') {
steps {
echo 'deploy to Production!'
}
}
}
post {
always {
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'notify@me', sendToIndividuals: false])
}
}
}
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3.5"
services:
petclinic:
image: spring-petclinic:latest
ports:
- "8080:8080"
links:
- mysql
mysql:
image: mysql:5.7
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=petclinic
- MYSQL_DATABASE=petclinic
volumes:
- "./conf.d:/etc/mysql/conf.d:ro"
Loading

0 comments on commit 3b72390

Please sign in to comment.