-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
64 lines (50 loc) · 1.37 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
def run(os) {
return {
docker.build("dynamo-consistency-${os}:${env.BUILD_ID}", "test/${os}").inside('-u root:root -v ${HOME}/public_html:/html') {
stage("${os}: Copy Source") {
sh """
mkdir /work
cp --parents `git ls-files` /work
"""
}
stage("${os}: Installation") {
sh "cd /work; python setup.py install"
}
stage("${os}: Unit Tests") {
sh '''
# Get pdflatex in path
source /root/.bashrc
cd /work
opsspace-test
# If dynamo installed, run additional tests
if which dynamo
then
mysqld_safe &
sleep 5
source /usr/local/dynamo/etc/profile.d/init.sh
test/dynamo/fillsql.sh
# Start server
test/dynamo/setupcert.sh
dynamod &
sleep 5
su -c 'test/dynamo/testinventory.sh' dynamo
fi
'''
}
stage("${os}: Copy Coverage") {
if (os == 'sl7') {
sh "cd /work; copy-coverage-html /html/coverage/${env.JOB_NAME}/${env.BUILD_NUMBER}"
} else {
echo 'Not going to store coverage results'
}
}
}
}
}
def osList = ['sl6', 'sl7']
node {
checkout scm
parallel osList.collectEntries{
["${it}": run(it)]
}
}