-
Notifications
You must be signed in to change notification settings - Fork 67
/
Jenkinsfile
107 lines (93 loc) · 2.51 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env groovy
pipeline {
agent { label 'executor-v2' }
options {
timestamps()
buildDiscarder(logRotator(numToKeepStr: '30'))
skipDefaultCheckout() // see 'post' below, once perms are fixed this is no longer needed
}
triggers {
cron(getDailyCronString())
}
stages {
stage('Checkout SCM') {
steps {
checkout scm
}
}
stage('Validate Changelog') {
steps { sh './bin/parse-changelog' }
}
stage('Run unit tests') {
steps {
sh './test_unit'
sh 'mv output/c.out .'
ccCoverage("gocov", "--prefix github.com/cyberark/summon")
}
post {
always {
junit 'output/junit.xml'
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'output/coverage.xml', conditionalCoverageTargets: '100, 0, 0', failUnhealthy: true, failUnstable: false, lineCoverageTargets: '74, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '92, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
}
}
}
stage('Build Release Artifacts') {
when {
not {
tag "v*"
}
}
steps {
sh './build --snapshot'
archiveArtifacts 'dist/goreleaser/'
}
}
stage('Build Release Artifacts and Create Pre Release') {
// Only run this stage when triggered by a tag
when { tag "v*" }
steps {
dir('./pristine-checkout') {
// Go releaser requires a pristine checkout
checkout scm
// Create draft release
sh "summon --yaml 'GITHUB_TOKEN: !var github/users/conjur-jenkins/api-token' ./build"
archiveArtifacts 'dist/goreleaser/'
}
}
}
stage('Run acceptance tests') {
steps {
sh './test_acceptance'
}
post {
always {
junit 'output/acceptance/*.xml'
}
}
}
stage('Validate installation script') {
parallel {
stage('Validate installation on Ubuntu 20:04') {
steps {
sh 'bin/installer-test --ubuntu-20.04'
}
}
stage('Validate installation on Ubuntu 18:04') {
steps {
sh 'bin/installer-test --ubuntu-18.04'
}
}
stage('Validate installation on Ubuntu 16:04') {
steps {
sh 'bin/installer-test --ubuntu-16.04'
}
}
}
}
}
post {
always {
cleanupAndNotify(currentBuild.currentResult)
}
}
}