-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
91 lines (88 loc) · 2.37 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env groovy
pipeline {
agent {
dockerfile {
filename 'Dockerfile.build'
}
}
stages {
stage('Bootstrap') {
steps {
echo 'Bootstrapping..'
sh 'go version'
}
}
stage('Lint') {
steps {
echo 'Linting..'
sh 'make lint-checkstyle'
}
}
stage('Test') {
steps {
echo 'Testing..'
sh 'make test-xml-short'
}
}
stage('Vendor') {
steps {
echo 'Fetching vendor dependencies..'
sh 'make vendor'
}
}
stage('Standard') {
stages {
stage('Build standard') {
steps {
echo 'Building..'
sh 'make DATE=reproducible BUILD_TAGS=release'
sh './bin/kwmserverd version && sha256sum ./bin/kwmserverd'
}
}
stage('Dist standard') {
steps {
echo 'Dist..'
sh 'test -z "$(git diff --shortstat 2>/dev/null |tail -n1)" && echo "Clean check passed."'
sh 'make check'
sh 'make dist PACKAGE_NAME_SUFFIX=-standard'
}
}
}
}
stage('Supported') {
stages {
stage('Build supported') {
steps {
echo 'Building..'
sh 'make DATE=reproducible BUILD_TAGS=release,supportedBuild'
sh './bin/kwmserverd version && sha256sum ./bin/kwmserverd'
}
}
stage('Dist supported') {
steps {
echo 'Dist..'
sh 'test -z "$(git diff --shortstat 2>/dev/null |tail -n1)" && echo "Clean check passed."'
sh 'make check'
sh 'make dist PACKAGE_NAME_SUFFIX=-supported'
}
}
}
}
stage('Test with coverage') {
steps {
echo 'Testing with coverage..'
sh 'make test-coverage COVERAGE_DIR=test/coverage.jenkins || true'
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'test/coverage.jenkins', reportFiles: 'coverage.html', reportName: 'Go Coverage Report HTML', reportTitles: ''])
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'test/coverage.jenkins/coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
}
}
}
post {
always {
junit allowEmptyResults: false, testResults: 'test/tests.xml'
recordIssues enabledForFailure: true, qualityGates: [[threshold: 400, type: 'TOTAL', unstable: true]], tools: [checkStyle(pattern: 'test/tests.lint.xml')]
archiveArtifacts 'dist/*.tar.gz'
cleanWs()
}
}
}