forked from OpenModelica/OMPython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
49 lines (49 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
pipeline {
agent none
stages {
stage('test') {
parallel {
stage('python2') {
agent {
label 'linux'
}
steps {
script {
def deps = docker.build('ompython-jenkins-python2', '--pull .jenkins/python2')
def dockergid = sh (script: 'stat -c %g /var/run/docker.sock', returnStdout: true).trim()
sh "docker pull openmodelica/openmodelica:v1.16.1-minimal" // Avoid timeout
deps.inside("-v /var/run/docker.sock:/var/run/docker.sock --network=host --pid=host --group-add '${dockergid}'") {
sh 'python2 setup.py build'
timeout(3) {
sh 'python2 /usr/local/bin/py.test -v --junitxml py2.xml tests'
}
sh 'HOME="$PWD" python2 setup.py install --user'
}
junit 'py2.xml'
}
}
}
stage('python3') {
agent {
label 'linux'
}
steps {
script {
def deps = docker.build('ompython-jenkins-python3', '--pull .jenkins/python3')
def dockergid = sh (script: 'stat -c %g /var/run/docker.sock', returnStdout: true).trim()
sh "docker pull openmodelica/openmodelica:v1.16.1-minimal" // Avoid timeout
deps.inside("-v /var/run/docker.sock:/var/run/docker.sock --network=host --pid=host --group-add '${dockergid}'") {
sh 'python3 setup.py build'
timeout(3) {
sh 'python3 /usr/local/bin/py.test -v --junitxml py3.xml tests'
}
sh 'HOME="$PWD" python3 setup.py install --user'
}
junit 'py3.xml'
}
}
}
}
}
}
}