forked from realsenseai/realsense_mipi_platform_driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLRS_libci_pipeline.groovy
More file actions
76 lines (71 loc) · 1.55 KB
/
Copy pathLRS_libci_pipeline.groovy
File metadata and controls
76 lines (71 loc) · 1.55 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
pipeline {
agent { label 'rs-orin-01.realsenseai.com' }
options {
timestamps()
timeout(time: 30, unit: 'MINUTES')
}
parameters {
booleanParam(
name: 'REBOOT',
description: 'When set the artifacts will be installed to target agent and the agent rebooted',
defaultValue: false,
)
string(
name: 'ARTIFACTS',
description: 'Jenkins job for artifacts to be installed on target agent',
defaultValue: "D4xx_Kernel_Module_Jetson_JP6"
)
string(
name: 'BUILD',
description: 'Build number for artifacts. Leave empty for last successful'
)
}
stages {
stage('Get artifacts') {
when {
expression { params.REBOOT == true }
}
steps {
script {
def buildSelector
if (params.BUILD?.trim()) {
buildSelector = specific(params.BUILD)
} else {
buildSelector = lastSuccessful()
}
copyArtifacts filter: '**/*.tar.bz2',
projectName: params.ARTIFACTS,
flatten: true,
selector: buildSelector,
target: 'artifacts/'
}
}
}
stage('Install artifacts') {
when {
expression { params.REBOOT == true }
}
steps {
sh """#!/bin/sh
rm -rf lib/modules
tar -xf artifacts/rootfs.tar.bz2
# external script on agent to install artifacts
sudo install.tegra.artifacts.sh
"""
}
post {
success {
sh 'nohup sudo reboot &'
}
}
}
stage('Pytest') {
steps {
sh """#!/bin/sh
pytest --tb=no -s test
"""
}
}
}
}