forked from jenkins-infra/jenkins-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
72 lines (68 loc) · 3.06 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
#!/usr/bin/env groovy
pipeline {
agent none
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 30, unit: 'MINUTES')
timestamps()
}
environment {
LANG = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
/* These environment variables make it feasible for Git to clone properly while
* inside the wacky confines of a Docker container
*/
GIT_COMMITTER_EMAIL = '[email protected]'
GIT_COMMITTER_NAME = 'Git'
GIT_AUTHOR_NAME = 'Git'
GIT_AUTHOR_EMAIL = '[email protected]'
}
stages {
stage('Verify') {
failFast true
parallel {
stage('Syntax') {
agent { label 'ruby' }
steps {
sh 'HOME=$PWD bundle install --without development plugins --path vendor/gems'
sh 'HOME=$PWD bundle exec rake spec_clean spec_prep'
sh 'bundle exec rake lint'
}
}
stage('Profiles') {
agent { label 'ruby' }
steps {
sh 'HOME=$PWD bundle install --without development plugins --path vendor/gems'
sh 'HOME=$PWD bundle exec rake spec_clean spec_prep'
sh 'bundle exec parallel_rspec spec/classes/profile'
junit 'tmp/rspec*.xml'
}
}
stage('Roles') {
agent { label 'ruby' }
steps {
sh 'HOME=$PWD bundle install --without development plugins --path vendor/gems'
sh 'HOME=$PWD bundle exec rake spec_clean spec_prep'
sh 'bundle exec parallel_rspec spec/classes/role'
junit 'tmp/rspec*.xml'
sh 'bundle exec parallel_rspec spec/defines'
junit 'tmp/rspec*.xml'
}
}
stage('vhost check') {
agent { label 'ruby' }
steps {
// Check that Confluence rewrite rules that contain '#' also include the 'NE' attribute
// to assure that the '#' in the rewrite is not escaped.
// This is an imperfect test that would have detected the most recent failures
sh 'if grep "RewriteRule.*#" dist/profile/templates/confluence/vhost.conf | grep -v NE,NC,L,QSA; then echo "Suspicious reference to ID in confluence RewriteRule URL without no expansion (NE) flag"; exit 1; fi'
// Check that Confluence rewrite rules don't duplicate the mistake of adding an extra
// '/' after the JENKINS portion of the URL.
sh 'if grep JENKINS// dist/profile/templates/confluence/vhost.conf; then echo "Extra / after JENKINS in Confluence URL"; exit 1; fi'
}
}
}
}
}
}
// vim: ft=groovy