forked from jenkinsci/custom-distribution-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
67 lines (63 loc) · 2.06 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
if (JENKINS_URL.contains('infra.ci.jenkins.io')) {
buildDockerAndPublishImage('custom-distribution-service', [dockerfile: 'Dockerfile.infra'])
return;
}
pipeline {
agent {
label 'linux'
}
stages {
stage('Checkout') {
steps{
checkout scm
}
}
stage('Spring Boot Build') {
steps {
withEnv([
"JAVA_HOME=${tool 'jdk8'}",
"PATH+MVN=${tool 'mvn'}/bin",
'PATH+JDK=$JAVA_HOME/bin',
]) {
timeout(60) {
script {
List<String> mvnOptions = ['-Dmaven.test.failure.ignore','verify']
infra.runMaven(
mvnOptions,
/*jdk*/ "8",
/*extraEnv*/ null,
/*settingsFile*/ null,
/*addToolEnv*/ false
)
if (isUnix()) {
sh 'mvn --batch-mode clean install -Denvironment=test -Prun-its'
}
else {
bat 'mvn --batch-mode clean install -Denvironment=test -Prun-its'
}
}
}
}
}
}
stage('React Build') {
agent {
docker {
label 'linux'
image 'node:12-alpine'
}
}
steps {
sh 'npm install'
}
}
stage('Archive') {
steps {
/* Archive the test results */
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts artifacts: '**/target/**/*.jar'
recordIssues(tools: [findBugs(pattern: '**/target/findbugsXml.xml', useRankAsPriority: true)])
}
}
}
}