-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththingsboard.yaml
189 lines (179 loc) · 6.7 KB
/
thingsboard.yaml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
package:
name: thingsboard
version: 3.8.1
epoch: 0
description: "Open-source IoT Platform - Device management, data collection, processing and visualization."
copyright:
- license: Apache-2.0
environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- dpkg
- fontconfig
- gnutar
- jq
- lcms2
- maven
- nodejs-16
- openjdk-17
- openjdk-17-default-jvm
- ttf-dejavu
- xz
- yarn
pipeline:
- uses: git-checkout
with:
expected-commit: fba282081592ad583cc5e52c6487c24fd9cf0f94
repository: https://github.com/thingsboard/thingsboard.git
tag: v${{package.version}}
- uses: patch
with:
patches: wire-schema.patch
- uses: maven/pombump
- runs: |
mvn clean install -DskipTests -Dlicense.skip=true
subpackages:
- name: "${{package.name}}-tb-js-executor"
description: "Executes user-defined JavaScript functions in isolation for the ThingsBoard rule engine."
dependencies:
runtime:
- nodejs-16
pipeline:
- name: Move tb-js-executor to target directories
runs: |
mkdir -p "${{targets.subpkgdir}}/usr/share/tb-js-executor"
mkdir -p "${{targets.subpkgdir}}/usr/bin"
cd msa/js-executor/target
cp -r src/* "${{targets.subpkgdir}}/usr/share/tb-js-executor"
cp -r package/linux/conf "${{targets.subpkgdir}}/usr/share/tb-js-executor"
cp -r package/linux/conf/* "${{targets.subpkgdir}}/usr/share/tb-js-executor/config"
cp -r start-js-executor.sh "${{targets.subpkgdir}}/usr/bin"
- name: Patch CVEs
runs: |
cd "${{targets.subpkgdir}}/usr/share/tb-js-executor"
resolutions='{
"@grpc/grpc-js": "^1.10.9",
"debug": "^4.3.1",
"fast-xml-parser": "^4.4.1",
"json5": "^2.2.2",
"moment": "^2.29.4",
"tough-cookie": "^4.1.3",
"xml2js": "^0.5.0",
"cookie": "^0.7.0"
}'
jq --argjson resolutions "$resolutions" '.resolutions += $resolutions' package.json > temp.json && mv temp.json package.json
jq '.dependencies.express = "^4.19.2"' package.json > temp.json && mv temp.json package.json
- name: Install nodejs dependencies
runs: |
cd "${{targets.subpkgdir}}/usr/share/tb-js-executor"
yarn install --production --non-interactive --network-concurrency 4 --network-timeout 100000 --mutex network && yarn cache clean --all
test:
pipeline:
- name: Test tb-js-executor server logs
uses: test/daemon-check-output
with:
start: "start-js-executor.sh"
timeout: 30
expected_output: |
Starting '\''ThingsBoard JavaScript Executor Microservice'\''
- name: "${{package.name}}-tb-mqtt-transport"
description: Handles MQTT-based device communication and API requests for ThingsBoard.
dependencies:
runtime:
- openjdk-17-default-jvm
pipeline:
- name: Extract tb-mqtt-transport to target directories
runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin
cd msa/transport/mqtt/target
dpkg-deb -x tb-mqtt-transport.deb ${{targets.subpkgdir}}
cp start-tb-mqtt-transport.sh ${{targets.subpkgdir}}/usr/bin
mkdir -p ${{targets.subpkgdir}}/config
cp ${{targets.subpkgdir}}/usr/share/tb-mqtt-transport/conf/* ${{targets.subpkgdir}}/config
test:
pipeline:
- name: Test mqtt-transport server logs
uses: test/daemon-check-output
with:
start: "start-tb-mqtt-transport.sh"
timeout: 30
expected_output: |
Starting '\''ThingsBoard MQTT Transport Microservice'\''
- name: "${{package.name}}-tb-node"
description: "Core service responsible for handling REST API, WebSocket subscriptions, and processing messages via the rule engine."
dependencies:
runtime:
- eudev
- fontconfig
- lcms2
- openjdk-17-default-jvm
- ttf-dejavu
pipeline:
- name: Extract tb-node to target directories
runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin
cd msa/tb-node/target
dpkg-deb -x thingsboard.deb ${{targets.subpkgdir}}
cp start-tb-node.sh ${{targets.subpkgdir}}/usr/bin
mkdir -p ${{targets.subpkgdir}}/config
cp -r ${{targets.subpkgdir}}/usr/share/thingsboard/conf/* ${{targets.subpkgdir}}/config
test:
pipeline:
- name: Test server logs
uses: test/daemon-check-output
with:
start: "start-tb-node.sh"
timeout: 30
expected_output: |
Starting '\''ThingsBoard Node Microservice'\''
- name: "${{package.name}}-tb-web-ui"
description: "Hosts static web UI content using a lightweight Express.js component"
dependencies:
runtime:
- nodejs-16
pipeline:
- name: Move tb-web-ui to target directories
runs: |
mkdir -p "${{targets.subpkgdir}}/usr/share/tb-web-ui"
mkdir -p "${{targets.subpkgdir}}/usr/bin"
cd msa/web-ui/target
cp -r src/* "${{targets.subpkgdir}}/usr/share/tb-web-ui"
cp -r package/linux/conf "${{targets.subpkgdir}}/usr/share/tb-web-ui"
cp -r package/linux/conf/* "${{targets.subpkgdir}}/usr/share/tb-web-ui/config"
cp -r start-web-ui.sh "${{targets.subpkgdir}}/usr/bin"
- name: Patch CVEs
runs: |
cd "${{targets.subpkgdir}}/usr/share/tb-web-ui"
resolutions='{
"color-string": "^1.5.5",
"follow-redirects": "^1.15.6",
"minimist": "^1.2.6",
"json5": "^2.2.2",
"moment": "^2.29.4",
"tinymce": "^7.0.0",
"cookie": "^0.7.0"
}'
jq --argjson resolutions "$resolutions" '.resolutions += $resolutions' package.json > temp.json && mv temp.json package.json
jq '.dependencies.express = "^4.19.2"' package.json > temp.json && mv temp.json package.json
- name: Install nodejs dependencies
runs: |
cd "${{targets.subpkgdir}}/usr/share/tb-web-ui"
yarn install --production --non-interactive --network-concurrency 4 --network-timeout 100000 --mutex network && yarn cache clean --all
test:
pipeline:
- name: Test tb-web-ui logs
uses: test/daemon-check-output
with:
start: "start-web-ui.sh"
timeout: 30
expected_output: |
Starting '\''ThingsBoard Web UI Microservice'\''
update:
enabled: true
github:
identifier: thingsboard/thingsboard
tag-filter: v
strip-prefix: v