-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
54 lines (53 loc) · 1.09 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
#!/usr/bin/env groovy
pipeline {
agent {
dockerfile {
filename 'Dockerfile.build'
}
}
options {
copyArtifactPermission('prometheus-kopano-exporter-release')
}
stages {
stage('Bootstrap') {
steps {
echo 'Bootstrapping..'
sh 'go version'
}
}
stage('Lint') {
steps {
echo 'Linting..'
sh 'make lint-checkstyle'
recordIssues enabledForFailure: true, qualityGates: [[threshold: 100, type: 'TOTAL', unstable: true]], tools: [checkStyle(id: 'golint', name: 'Golint', pattern: 'test/tests.lint.xml')]
}
}
stage('Vendor') {
steps {
echo 'Fetching vendor dependencies..'
sh 'make vendor'
}
}
stage('Build') {
steps {
echo 'Building..'
sh 'make DATE=reproducible'
sh './bin/prometheus-kopano-exporter version && sha256sum ./bin/prometheus-kopano-exporter'
}
}
stage('Dist') {
steps {
echo 'Dist..'
sh 'test -z "$(git diff --shortstat 2>/dev/null |tail -n1)" && echo "Clean check passed."'
sh 'make check'
sh 'make dist'
}
}
}
post {
always {
archiveArtifacts 'dist/*.tar.gz'
cleanWs()
}
}
}