-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathJenkinsfile
66 lines (52 loc) · 1.85 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
65
66
#!groovy
node() {
def builds = [:]
def platforms = [:]
sh 'mkdir -p catkin_ws/src/roscco'
dir('catkin_ws/src/roscco') {
checkout scm
sh "git submodule update --init --recursive"
def image = docker.build("catkin_make-build:${env.BUILD_ID}")
def output = image.inside {
sh returnStdout: true, script: "cmake -LA ./oscc/firmware | grep 'VEHICLE_VALUES' | cut -d'=' -f 2"
}
platforms = output.trim().tokenize(';')\
}
for(int j=0; j<platforms.size(); j++) {
def platform_idx = j
def platform = platforms[platform_idx]
builds[platform] = {
node {
sh 'mkdir -p catkin_ws/src/roscco'
dir('catkin_ws/src/roscco') {
checkout scm
sh "git submodule update --init --recursive"
}
image = docker.build("catkin_make-build:${env.BUILD_ID}", "./catkin_ws/src/roscco")
stage("Build ${platform}"){
image.inside {
sh ". /opt/ros/kinetic/setup.sh && \
cd catkin_ws && \
catkin_make -DVEHICLE=${platform}"
echo "${platform}: Build Complete!"
}
}
def workspace = pwd()
stage("Test ${platform}"){
image.inside{
sh ". /opt/ros/kinetic/setup.sh && \
cd catkin_ws && \
ROS_HOME=${workspace} ROS_LOG_DIR=${workspace} catkin_make run_tests -DVEHICLE=${platform} && \
catkin_test_results --verbose"
}
}
}
}
}
try {
parallel builds
}
finally {
deleteDir()
}
}