Skip to content

Commit 90351b4

Browse files
committed
Tidy up build
1 parent ef1d578 commit 90351b4

File tree

3 files changed

+69
-87
lines changed

3 files changed

+69
-87
lines changed

Jenkinsfile

Lines changed: 69 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,71 @@
11
#!groovy
22

3-
def checkoutCode() {
4-
stage 'checkout'
5-
checkout scm: [$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'https://github.com/codesqueak/jackson-json-crypto.git']]]
6-
}
7-
8-
def build() {
9-
stage 'build'
10-
sh './gradlew clean build -x test'
11-
}
12-
13-
def test() {
14-
stage 'test'
15-
sh './gradlew test'
16-
}
17-
18-
def junitreport() {
19-
stage 'JUnit report'
20-
step([$class: 'JUnitResultArchiver', testResults: 'build/test-results/test/TEST-*.xml'])
21-
}
22-
23-
def findbugsreport() {
24-
stage 'Findbugs report'
25-
step([$class: 'FindBugsPublisher', pattern: 'build/reports/findbugs/main.xml'])
26-
}
27-
28-
def jacocoreport() {
29-
stage 'Jacoco report'
30-
step([$class: 'JacocoPublisher', execPattern: 'build/jacoco/jacocoTest.exec', pattern: 'build/jacoco/classpathdumps/net/codingrodent/**/*.class'])
31-
}
32-
33-
34-
stage 'execute Z80 build'
35-
36-
node {
37-
checkoutCode()
38-
build()
39-
test()
40-
junitreport()
41-
findbugsreport()
42-
jacocoreport()
43-
}
3+
pipeline {
4+
agent any
5+
stages {
6+
stage('Checkout') {
7+
steps { //Checking out the repo
8+
checkout scm: [$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'https://github.com/codesqueak/jackson-json-crypto.git']]]
9+
echo env.GIT_BRANCH
10+
sh 'echo $GIT_BRANCH'
11+
}
12+
}
13+
14+
15+
16+
stage('Build') {
17+
steps { //Build using jenkins
18+
sh './gradlew clean build test'
19+
}
20+
}
21+
22+
stage('Jar') {
23+
steps { //Make a jar file
24+
sh './gradlew jar'
25+
}
26+
}
27+
28+
stage('branch') {
29+
steps { //branch check
30+
echo env.GIT_BRANCH
31+
sh 'echo $GIT_BRANCH'
32+
}
33+
}
34+
35+
stage ('develop') {
36+
when {
37+
expression { env.GIT_BRANCH == 'origin/develop' }
38+
}
39+
steps {
40+
echo "Hello origin/develop"
41+
}
42+
}
43+
44+
stage ('release') {
45+
when {
46+
expression { env.GIT_BRANCH == 'origin/release' }
47+
}
48+
steps {
49+
echo "Hello origin/release"
50+
}
51+
}
52+
53+
stage ('master') {
54+
when {
55+
expression { env.GIT_BRANCH == 'origin/master' }
56+
}
57+
steps {
58+
echo "Hello origin/master"
59+
}
60+
}
61+
62+
63+
}
64+
post {
65+
success {
66+
junit testResults: '**/test-results/test/TEST-*.xml'
67+
jacoco execPattern: '**/jacoco/jacocoTest.exec'
68+
recordIssues enabledForFailure: true, tool: spotBugs(pattern: '**/reports/spotbugs/*.xml')
69+
}
70+
}
71+
}

build.gradle

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,6 @@ jacocoTestReport {
133133
}
134134
}
135135

136-
spotbugsMain {
137-
reports {
138-
html {
139-
enabled = true
140-
}
141-
}
142-
}
143-
144-
spotbugsTest {
145-
reports {
146-
html {
147-
enabled = true
148-
}
149-
}
150-
}
151-
152136
spotbugs {
153137
toolVersion = '4.1.4'
154138
ignoreFailures = false
@@ -188,10 +172,6 @@ artifactory {
188172
}
189173
}
190174

191-
check.dependsOn jacocoTestReport
192-
test.dependsOn javadoc
193-
jar.dependsOn createPom
194-
jar.dependsOn setVersion
195175

196176
dependencies {
197177
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.11.3'

codeformat.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)