forked from jenkins-infra/jenkins-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
57 lines (52 loc) · 1.77 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
#!/usr/bin/env groovy
pipeline {
// All Linux agents have ruby + bundle installed through `asdf`
agent { label 'linux-amd64-docker' }
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 15, unit: 'MINUTES')
timestamps()
}
environment {
// To allow using ASDF shims
PATH = "${env.PATH}:/home/jenkins/.asdf/shims:/home/jenkins/.asdf/bin"
}
stages {
stage('Prepare Puppet Project') {
steps {
// Install `yq` until https://github.com/jenkins-infra/packer-images/pull/277 is merged and available
sh '''
if ! command -v yq >/dev/null 2>&1
then
asdf plugin-add yq https://github.com/sudermanjr/asdf-yq.git || true
asdf install yq 4.25.3
asdf global yq 4.25.3
fi
'''
// Install Dependencies once for all
sh 'bash ./scripts/setupgems.sh'
// For auditing purposes: if tests are failing with "module not found" or "object not found" for instance
archiveArtifacts '.fixtures.yml'
}
}
stage('Verify') {
parallel {
stage('Syntax') {
steps {
sh 'bundle exec rake lint'
}
}
stage('Profiles') {
steps {
sh 'bundle exec parallel_rspec spec/classes/profile'
}
}
stage('Roles') {
steps {
sh 'bundle exec parallel_rspec spec/classes/role'
}
}
}
}
}
}