forked from wavecomp/waveext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
55 lines (47 loc) · 1.6 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
#!/usr/bin/env groovy
// Jenkinsfle for waveflow build
//
// Quang Truong - Created: 02/09/2018
@Library('wavecomp') _
def nodeLabel = 'sw'
node(selectBuildNode(nodeLabel)) {
def currentws = ''
stage('Build') {
try {
deleteDir()
dir("waveflow") {
checkout scm // Repo waveflow
echo "Using repo 'waveflow', branch '$BRANCH_NAME'."
currentws = pwd()
echo 'Set python virtual environment ...'
sh "virtualenv -p python3 ${currentws}"
// Fix virtualenv pip issue: https://stackoverflow.com/questions/7911003/cant-install-via-pip-with-virtualenv
sh """#!/bin/bash
cd ${currentws}
source bin/activate
bin/python bin/pip install -r requirements.txt
source wf_env.sh ${currentws}
wfbuild r"""
}
} catch (e) {
currentBuild.result = "FAILED"
notifyBuild(currentBuild.result, 'waveflow build')
throw e
}
}
stage('WaveFlow Tests') {
try {
dir("${currentws}/test") {
echo 'waveflow Testing ...'
sh """#!/bin/bash
. ${currentws}/bin/activate
. ${currentws}/wf_env.sh ${currentws}
pytest -n 4"""
}
} catch (e) {
currentBuild.result = "FAILED"
notifyBuild(currentBuild.result, 'waveflow test')
throw e
}
}
}