This repository was archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathJenkinsfile
More file actions
129 lines (107 loc) · 2.46 KB
/
Jenkinsfile
File metadata and controls
129 lines (107 loc) · 2.46 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/env groovy
pipeline {
agent { label 'executor-v2' }
options {
timestamps()
buildDiscarder(logRotator(daysToKeepStr: '30'))
}
triggers {
cron(getDailyCronString())
}
stages {
stage('Validate Changelog') {
steps { sh './bin/parse-changelog.sh' }
}
stage('Prepare CC Report Dir'){
steps {
script {
ccCoverage.dockerPrep()
sh 'mkdir -p coverage'
}
}
}
stage('Test Ruby 2.7') {
environment {
RUBY_VERSION = '2.7'
}
steps {
sh './test.sh'
}
post {
always {
junit 'spec/reports/*.xml, features/reports/*.xml'
}
}
}
stage('Test Ruby 3.0') {
environment {
RUBY_VERSION = '3.0'
}
steps {
sh './test.sh'
}
post {
always {
junit 'spec/reports/*.xml, features/reports/*.xml'
}
}
}
stage('Submit Coverage Report'){
steps{
sh 'ci/submit-coverage'
publishHTML([reportDir: 'coverage', reportFiles: 'index.html', reportName: 'Coverage Report', reportTitles: '', allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true])
}
post {
always {
archiveArtifacts artifacts: "coverage/.resultset.json", fingerprint: false
}
}
}
stage('Build standalone image') {
steps {
sh './build-standalone'
}
}
stage('Scan Docker image') {
parallel {
stage('Scan Docker image for fixable vulns') {
steps {
scanAndReport("cyberark/conjur-cli:latest", "HIGH", false)
}
}
stage('Scan Docker image for total vulns') {
steps {
scanAndReport("cyberark/conjur-cli:latest", "NONE", true)
}
}
}
}
stage('Push standalone image to DockerHub') {
when { tag "v*" }
steps {
sh './push-image'
}
}
// Only publish to RubyGems if the HEAD is
// tagged with the same version as in version.rb
stage('Publish to RubyGems') {
when {
expression { currentBuild.resultIsBetterOrEqualTo('SUCCESS') }
tag "v*"
}
steps {
// Clean up first
sh 'git clean -fxd'
sh './publish.sh'
// Clean up again...
sh 'git clean -fxd'
deleteDir()
}
}
}
post {
always {
cleanupAndNotify(currentBuild.currentResult)
}
}
}