-
Notifications
You must be signed in to change notification settings - Fork 25
/
Jenkinsfile
46 lines (43 loc) · 1.25 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
// Update this once Bill's helpers are merged into the shared library repo
@Library('puppet_jenkins_shared_libraries') _
pipeline{
agent {
label 'k8s-worker'
}
environment {
RUBY_VERSION='2.5.7'
GEM_SOURCE='https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/'
RAKE_SETUP_TASK='rake acceptance:setup'
RAKE_TEST_TASK='rake acceptance:run_tests'
RAKE_TEARDOWN_TASK='rake acceptance:tear_down'
CI='true'
RESULTS_FILE_NAME='rspec_junit_results.xml'
}
stages{
stage('Setup') {
steps {
echo 'Bundle Install'
bundleInstall env.RUBY_VERSION
bundleExec env.RUBY_VERSION, env.RAKE_SETUP_TASK
}
}
stage('Run Tests') {
steps {
echo 'Run Tests'
bundleExec env.RUBY_VERSION, env.RAKE_TEST_TASK
}
}
}
post{
always {
script {
if(fileExists(env.RESULTS_FILE_NAME)) {
junit testResults: env.RESULTS_FILE_NAME, allowEmptyResults: true
}
}
}
cleanup {
bundleExec env.RUBY_VERSION, env.RAKE_TEARDOWN_TASK
}
}
}