forked from Beckhoff/CCAT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
134 lines (124 loc) · 4.09 KB
/
.gitlab-ci.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
image: ${REGISTRY_HOST}/beckhoff/docker-ubuntu-cached:latest
stages:
- build
- test
- trigger
.build-module: &build-module
stage: build
script:
- apt-get update > /dev/null && apt-get install -y build-essential wget git unzip bc > /dev/null
- wget -nv --no-check-certificate -O artifacts.zip https://${GITLAB_HOST}/beckhoff/build-kernel/builds/artifacts/${KERNEL_REF}/download?job=${KERNEL_JOB}
- unzip -q artifacts.zip
- make KDIR=kernel-modules/lib/modules/*/build
artifacts:
paths:
- ccat.ko
- ccat_netdev.ko
- ccat_gpio.ko
- ccat_sram.ko
- ccat_systemtime.ko
- ccat_update.ko
build-arm-module:
<<: *build-module
variables:
KERNEL_JOB: 'build-arm-kernel'
KERNEL_REF: 'stable-rt'
ARCH: 'arm'
CROSS_COMPILE: 'arm-none-eabi-'
build-i386-module:
<<: *build-module
variables:
KERNEL_JOB: 'build-i386-kernel'
KERNEL_REF: 'stable-rt'
ARCH: 'i386'
build-x86_64-module:
<<: *build-module
variables:
KERNEL_JOB: 'build-x86_64-kernel'
KERNEL_REF: 'stable-rt'
ARCH: 'x86_64'
.test: &test
image: ${REGISTRY_HOST}/beckhoff/test_runner:2.3-cx9020-ccat
stage: test
script:
- tar -czf tests.tar.gz ./scripts ./unittest ccat.ko ccat_netdev.ko ccat_gpio.ko ccat_sram.ko ccat_systemtime.ko ccat_update.ko
- 50_power.sh ${DEVICE_ID}-${DEVICE} 0
- source 09_init.sh
- wget -nv --no-check-certificate -O artifacts.zip https://${GITLAB_HOST}/beckhoff/build-kernel/builds/artifacts/${KERNEL_REF}/download?job=${KERNEL_JOB}
- unzip -q artifacts.zip && rm artifacts.zip
- wget -nv --no-check-certificate -O artifacts.zip https://${GITLAB_HOST}/beckhoff/build-alpine/builds/artifacts/${ROOTFS_REF}/download?job=${ROOTFS_JOB}
- unzip -q artifacts.zip
- 30_prepare_test.sh ${DEVICE_ID}-${DEVICE} vmlinuz rootfs.cpio.xz nfs
- 50_power.sh ${DEVICE_ID}-${DEVICE} 1
- 51_wait.sh ${DEVICE_ID}-${DEVICE} root
- scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./tests.tar.gz root@${TEST_DEVICE_IP}:~/
- ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${TEST_DEVICE_IP} tar -xf ./tests.tar.gz
- ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${TEST_DEVICE_IP} ./unittest/load-module.sh
- ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${TEST_DEVICE_IP} ./unittest/test-all.sh ${LOCAL_IP} ${SERVER_IP}
test-cx2030-x64:
<<: *test
variables:
DEVICE: 'CX2030'
DEVICE_ID: 'CX05'
LOCAL_IP: 'fd00:bbbb::cca5/64'
SERVER_IP: 'fd00:bbbb::17'
KERNEL_REF: 'stable-rt'
KERNEL_JOB: 'build-x86_64-kernel'
ROOTFS_JOB: 'build-x86_64'
ROOTFS_REF: 'stable'
dependencies:
- build-x86_64-module
tags:
- CX05-CX2030
test-cx5140-x64:
<<: *test
variables:
DEVICE: 'CX5140'
DEVICE_ID: 'CX03'
LOCAL_IP: 'fd00:bbbb::cca3/64'
SERVER_IP: 'fd00:bbbb::17'
KERNEL_REF: 'stable-rt'
KERNEL_JOB: 'build-x86_64-kernel'
ROOTFS_JOB: 'build-x86_64'
ROOTFS_REF: 'stable'
dependencies:
- build-x86_64-module
tags:
- CX03-CX5140
test-cx5020:
<<: *test
variables:
DEVICE: 'CX5020'
DEVICE_ID: 'CX01'
LOCAL_IP: 'fd00:bbbb::cca1/64'
SERVER_IP: 'fd00:bbbb::17'
KERNEL_REF: 'stable-rt'
KERNEL_JOB: 'build-i386-kernel'
ROOTFS_JOB: 'build-i386'
ROOTFS_REF: 'stable'
dependencies:
- build-i386-module
tags:
- CX01-CX5020
test-cx9020-arm:
<<: *test
variables:
DEVICE: 'CX9020'
DEVICE_ID: 'CX09'
LOCAL_IP: 'fd00:bbbb::cca9/64'
SERVER_IP: 'fd00:bbbb::17'
KERNEL_REF: 'stable-rt'
KERNEL_JOB: 'build-arm-kernel'
ROOTFS_JOB: 'build-arm'
ROOTFS_REF: 'stable'
dependencies:
- build-arm-module
tags:
- CX09-CX9020
trigger:
stage: trigger
except:
- triggers
script:
- curl -k -X POST -F token=$SELFTRIGGER_TOKEN -F "ref=${CI_COMMIT_REF_NAME}" -F "variables[KERNEL_REF]=prepatch" https://${GITLAB_HOST}/api/v3/projects/12/trigger/builds
- curl -k -X POST -F token=$SELFTRIGGER_TOKEN -F "ref=${CI_COMMIT_REF_NAME}" -F "variables[KERNEL_REF]=rt-devel" https://${GITLAB_HOST}/api/v3/projects/12/trigger/builds