forked from sdgtt/jenkins-shared-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibrary.groovy
47 lines (43 loc) · 1.53 KB
/
Library.groovy
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
class Library {
def stage(String stage_name) {
switch (stage_name) {
case 'UpdateBOOTFiles':
println('Added Stage UpdateBOOTFiles')
cls = {
stage('Update BOOT Files') {
nebula('dl.bootfiles --design-name=' + board)
nebula('manager.update-boot-files --folder=outs')
}
};
break
case 'CollectLogs':
println('Added Stage CollectLogs')
cls = {
stage('Collect Logs') {
echo 'Collect Logs'
}
};
break
case 'PyADITests':
cls = {
stage('Run Python Tests') {
ip = nebula('uart.get-ip')
println('IP: ' + ip)
sh 'git clone https://github.com/analogdevicesinc/pyadi-iio.git'
dir('pyadi-iio')
{
sh 'ls'
run('pip3 install -r requirements.txt')
run('pip3 install -r requirements_dev.txt')
run('pip3 install pylibiio')
run("python3 -m pytest -v -s --uri='ip:"+ip+"' -m " + board.replaceAll('-', '_'))
}
}
}
break
default:
throw new Exception('Unknown library stage: ' + stage_name)
}
return cls
}
}