Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f5c358c
Update AppTest.java
beedemo-dev Aug 15, 2020
fa8e178
Update Jenkinsfile
beedemo-dev Aug 15, 2020
920235a
Update pom.xml
beedemo-dev Aug 15, 2020
fab0037
Update pom.xml
beedemo-dev Aug 15, 2020
f5849d3
Update pom.xml
beedemo-dev Aug 15, 2020
2477b1a
Update Jenkinsfile
beedemo-dev Aug 15, 2020
58b9bfa
Update AppTest.java
beedemo-dev Aug 15, 2020
9056e20
Update pom.xml
beedemo-dev Aug 15, 2020
075d376
Update Jenkinsfile
beedemo-dev Aug 15, 2020
2dd6c10
Update Jenkinsfile
beedemo-dev Aug 15, 2020
7c80bf0
Update pom.xml
beedemo-dev Aug 15, 2020
df9fb44
Update Jenkinsfile
beedemo-dev Aug 15, 2020
ad3c33d
Update Jenkinsfile
beedemo-dev Aug 15, 2020
840aeb1
Update Jenkinsfile
beedemo-dev Aug 15, 2020
08f0bfe
Update Jenkinsfile
beedemo-dev Aug 15, 2020
e3f423a
Update Jenkinsfile
beedemo-dev Aug 15, 2020
f7838dd
Update Jenkinsfile
beedemo-dev Aug 15, 2020
51ecd52
Update Jenkinsfile
beedemo-dev Aug 15, 2020
de889fa
Update Jenkinsfile
beedemo-dev Aug 15, 2020
dbac8a4
Update Jenkinsfile
beedemo-dev Aug 15, 2020
2595ac5
Update Jenkinsfile
beedemo-dev Aug 15, 2020
39554f2
Update Jenkinsfile
beedemo-dev Aug 15, 2020
03d27e3
Update App.java
beedemo-dev Aug 15, 2020
9226455
Update Jenkinsfile
beedemo-dev Aug 15, 2020
032bae5
Update Jenkinsfile
beedemo-dev Aug 15, 2020
68b8325
Update App.java
beedemo-dev Aug 16, 2020
28f2d02
Update mvn-pod.yaml
beedemo-dev Aug 17, 2020
a431ce3
Update mvn-pod.yaml
beedemo-dev Aug 17, 2020
b60436a
Update Jenkinsfile
beedemo-dev Aug 17, 2020
0978b7e
Update mvn-pod.yaml
beedemo-dev Aug 17, 2020
68c0f4e
Update mvn-pod.yaml
beedemo-dev Aug 17, 2020
7afbf2d
Update Jenkinsfile
beedemo-dev Aug 17, 2020
7d9f88b
Update mvn-pod.yaml
beedemo-dev Aug 17, 2020
892a7de
Update Jenkinsfile
beedemo-dev Aug 17, 2020
3705b44
Update Jenkinsfile
beedemo-dev Aug 17, 2020
444c9d4
Update Jenkinsfile
beedemo-dev Aug 17, 2020
2f51caa
Update mvn-pod.yaml
beedemo-dev Aug 17, 2020
191f224
Update Jenkinsfile
beedemo-dev Aug 17, 2020
5641246
Update Jenkinsfile
beedemo-dev Aug 17, 2020
b4d3c7c
Update Jenkinsfile
beedemo-dev Aug 17, 2020
8bd2501
Update Jenkinsfile
beedemo-dev Aug 17, 2020
6613a23
Update Jenkinsfile
beedemo-dev Aug 17, 2020
0deccfd
Update App.java
beedemo-dev Aug 19, 2020
22f2151
Update App.java
beedemo-dev Aug 19, 2020
88041c3
Update App.java
beedemo-dev Aug 19, 2020
f330405
Update App.java
beedemo-dev Aug 19, 2020
a3deb9a
Update App.java
beedemo-dev Aug 19, 2020
e56466d
Update App.java
beedemo-dev Aug 19, 2020
c55c577
Update App.java
beedemo-dev Aug 19, 2020
abbf17f
Update App.java
beedemo-dev Aug 19, 2020
a014ea6
Update Jenkinsfile
beedemo-dev Aug 20, 2020
e6dd9b6
Update App.java
beedemo-dev Aug 20, 2020
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
41 changes: 22 additions & 19 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,48 @@ pipeline {
agent {
kubernetes {
label 'maven-alpine-pod'
yamlFile 'mvn-pod.yaml'
podRetention always()
idleMinutes 120
yamlFile 'mvn-pod.yaml'
}
}
stages {
stage ('Build') {
stage ('Build and Analysis') {
steps {
container ('maven') {
sh 'mvn -B -DskipTests clean package'
sh 'mvn -V -q -e clean verify -Dmaven.test.failure.ignore'
}
}
}
stage ('Test') {
steps {
container ('maven') {
sh 'mvn test'
}
}
post {
always {
junit 'target/surefire-reports/*.xml'
jacoco()
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('Analysis') {
stage ('Test') {
steps {
container ('maven') {
sh "mvn --batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd findbugs:findbugs"
}
container ('maven') {
sh 'mvn -q test'
}
}
post {
always {
recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()]
recordIssues enabledForFailure: true, tool: checkStyle()
recordIssues enabledForFailure: true, tool: cpd(pattern: '**/target/cpd.xml')
recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/target/pmd.xml')
junit 'target/surefire-reports/*.xml'
}
}
}
stage ('Deliver') {
when {
beforeAgent true
branch 'master'
}
steps {
container ('maven') {
sh './jenkins/scripts/deliver.sh'
Expand Down
2 changes: 2 additions & 0 deletions mvn-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ kind: Pod
metadata:
name: maven-alpine-pod
spec:
securityContext:
runAsUser: 1000
containers:
- name: maven
image: maven:3-alpine
Expand Down
65 changes: 65 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,71 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.13.0</version>
<executions>
<execution>
<goals>
<goal>check</goal>
<goal>cpd-check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<configLocation>google_checks.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<configLocation>google_checks.xml</configLocation>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
4 changes: 2 additions & 2 deletions src/main/java/com/mycompany/app/App.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.mycompany.app;

/**
* Hello world!
* Hello world app.
*/
public class App
public class App
{

private final String message = "Hello World!";
Expand Down