-
Notifications
You must be signed in to change notification settings - Fork 48
/
jenkins.groovy
94 lines (87 loc) · 1.96 KB
/
jenkins.groovy
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
//Skip Branch Indexing builds
//unless it is the first build for that job, then run it
//update build status to previous job's status
if (currentBuild.buildCauses.toString().contains('BranchIndexingCause'))
{
print "Build skipped due to trigger being Branch Indexing."
if (currentBuild.previousBuild)
{
if(currentBuild.previousBuild.result == 'SUCCESS')
{
currentBuild.result = 'SUCCESS'
return
}
else
{
currentBuild.result = 'FAILURE'
return
}
}
}
pipeline
{
agent none
options
{
ansiColor('xterm')
buildDiscarder logRotator(artifactDaysToKeepStr: '30', artifactNumToKeepStr: '5', daysToKeepStr: '30', numToKeepStr: '30')
timestamps()
}
environment
{
CHEF_LICENSE = 'accept'
}
stages
{
stage('Run Tests')
{
parallel
{
stage('Integration Tests')
{
agent
{
label 'linux'
}
steps
{
sh '''
vagrant plugin install vagrant-vbguest | true
kitchen verify openjdk-centos-83
kitchen destroy openjdk-centos-83
kitchen verify openjdk-ubuntu-2004
kitchen destroy openjdk-ubuntu-2004
kitchen verify openjdk-debian-1010
kitchen destroy openjdk-debian-1010
'''
}
post
{
always
{
cleanWs()
}
}
}
stage('Run Rspec Tests')
{
agent
{
label 'linux'
}
steps
{
sh 'chef exec rspec'
}
post
{
always
{
cleanWs()
}
}
}
}
}
}
}