Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 40 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
#!groovy
mavenProject {
org = 'beedemo'
repo = 'todo-api'
jdk = '8'
pipeline {
agent {
kubernetes {
label 'maven-alpine-pod'
yamlFile 'mvn-pod.yaml'
}
}
stages {
stage ('Build and Analysis') {
steps {
container ('maven') {
sh 'mvn -V -e clean verify -Dmaven.test.failure.ignore'
}
}
post {
always {
publishCoverage adapters: [jacoco(path: '**/*/jacoco.xml', thresholds: [[failUnhealthy: true, thresholdTarget: 'Line', unhealthyThreshold: 60.0]])], sourceFileResolver: sourceFiles('NEVER_STORE')
recordIssues enabledForFailure: true, tools: [java(), javaDoc()], aggregatingResults: 'true', id: 'java', name: 'Java'
recordIssues enabledForFailure: true, tool: errorProne(), healthy: 1, unhealthy: 20
recordIssues enabledForFailure: true, tools: [pmdParser(pattern: 'target/pmd.xml'),
spotBugs(pattern: 'target/spotbugsXml.xml')],
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
recordIssues enabledForFailure: true, tools: [checkStyle(pattern: 'target/checkstyle-result.xml'),
cpd(pattern: 'target/cpd.xml')]
}
}
}
stage ('Test') {
steps {
container ('maven') {
sh 'mvn test'
}
}
post {
always {
junit 'target/surefire-reports/*.xml'
}
}
}
}
}
10 changes: 10 additions & 0 deletions mvn-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: Pod
metadata:
name: maven-alpine-pod
spec:
containers:
- name: maven
image: maven:3-alpine
command:
- cat
tty: true
3 changes: 2 additions & 1 deletion src/main/java/com/cloudbees/examples/todo/api/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* Main class.
*
*/
public class Main {
public class Main
{
// Base URI the Grizzly HTTP server will listen on
public static final String BASE_URI = "http://localhost:8181/";

Expand Down