-
Notifications
You must be signed in to change notification settings - Fork 385
/
Jenkinsfile
63 lines (60 loc) · 2.49 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
pipeline {
agent any
stages {
stage('Lint') {
failFast true
parallel {
stage('Lint: ShellCheck') {
steps {
sh '''
set -eux
shellcheck core/bin/hbox-* core/sbin/start-history-server.sh core/libexec/hbox-common-env.sh
find tests -name '*.sh' | xargs shellcheck
'''
}
}
stage('Lint: Maven Pom Format') {
steps {
sh './mvnw -V -B sortpom:verify -Dsort.verifyFail=STOP'
}
}
stage('Lint: Check Maven Plugins') {
steps {
sh './mvnw -V -B artifact:check-buildplan'
}
}
}
}
stage('Build') {
stages {
stage('Build: Maven Verify') {
steps {
sh './mvnw -B clean verify'
}
}
stage('Build: Reproducible on tags') {
when {
buildingTag()
}
steps {
sh '''
set -eux
./mvnw -B clean install -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false
./mvnw -B clean
mkdir -p target
true artifact:compare should not contain warning or error
trap 'cat target/build.log' ERR
./mvnw -B -l target/build.log package artifact:compare -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false
test 0 = "$(sed -n '/^\\[INFO\\] --- maven-artifact-plugin:[^:][^:]*:compare/,/^\\[INFO\\] ---/ p' target/build.log | grep -c '^\\[\\(WARNING\\|ERROR\\)\\]')"
true all files should be ok
trap 'find . -name "*.buildcompare" -print0 | xargs -0 cat' ERR
find . -name '*.buildcompare' -print0 | xargs -0 grep -q '^ko=0$'
trap '' ERR
find . -name "*.buildcompare" -print0 | xargs -0 cat
'''
}
}
}
}
}
}