-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.drone.yml
287 lines (237 loc) · 7.21 KB
/
.drone.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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
---
kind: pipeline
type: exec
name: replica.one
clone:
depth: 25
steps:
- name: submodules
commands:
- git submodule update --init --recursive --depth 25
- name: makeDirectoryStructure
commands:
- echo $${DRONE_BRANCH} | iconv -t ascii//TRANSLIT | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z > branchName
- mkdir $(cat branchName)
- date '+%Y-%m-%d' > dateDirectory
# Templates
- name: buildTemplate
nodeinfo: &buildTemplate
environment:
CTARGET: architecture
target: target
TARGET_DISTRO: gentoo
commands:
- cd .. && mkdir replica-$${target}-$${CTARGET}-$${TARGET_DISTRO}
- cd replica-$${target}-$${CTARGET}-$${TARGET_DISTRO}
- cp -a ../src/. ./
- make V=1 J=$(($(nproc) + 1)) package_$${target}
- mkdir -p ./$${target}/$(cat dateDirectory)
- cp -a ./output/. ./$${target}/$(cat dateDirectory)/
- rsync -a ./$${target} ../src/$(cat branchName)/
depends_on: [submodules]
- name: buildTemplateNoOutput
nodeinfo: &buildTemplateNoOutput
environment:
CTARGET: architecture
target: target
TARGET_DISTRO: gentoo
commands:
- cd .. && mkdir replica-$${target}-$${CTARGET}-$${TARGET_DISTRO}
- cd replica-$${target}-$${CTARGET}-$${TARGET_DISTRO}
- cp -a ../src/. ./
- make V=1 J=$(($(nproc) + 1)) package_$${target}
depends_on: [submodules]
- name: artifactsTemplate
nodeinfo: &artifactsTemplate
environment:
DRONE_USER:
from_secret: droneUser
DRONE_PASSWORD:
from_secret: dronePassword
DRONE_SERVER:
from_secret: droneServer
DRONE_DIRECTORY_PATH:
from_secret: droneDirectoryPath
DRONE_RELEASES_PATH:
from_secret: droneReleasesPath
depends_on: [
# Toolchain targets
'arm:toolchain', 'arm64:toolchain', 'amd64:toolchain', 'arm-musl:toolchain', 'arm64-musl:toolchain', 'amd64-musl:toolchain',
# Device targets
'arm64:tn48m', 'arm64:tn4810m', 'arm64:tx4810', 'arm64:as5114-48x', 'arm64:rpi4:gentoo', 'arm64:rpi4:debian', 'amd64:sn2010',
'arm:ecw5211-l-t', 'arm64:methode-udpu', 'arm64:cn9130-crb', 'arm:clearfog-base', 'arm64:puzzle-m801',
# Generic targets
'arm:vmlinux', 'arm64:vmlinux', 'amd64:vmlinux',
# System targets
'arm:system', 'arm64:system', 'amd64:system', 'arm-musl:system', 'arm64-musl:system', 'amd64-musl:system',
# Package targets
'arm64:package'
]
# Toolchain targets
- name: arm:toolchain
<<: *buildTemplate
environment:
CTARGET: armv7a-unknown-linux-gnueabihf
target: toolchain
- name: arm64:toolchain
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: toolchain
- name: amd64:toolchain
<<: *buildTemplate
environment:
CTARGET: x86_64-multilib-linux-gnu
target: toolchain
- name: arm-musl:toolchain
<<: *buildTemplate
environment:
CTARGET: armv7a-unknown-linux-musleabihf
target: toolchain
- name: arm64-musl:toolchain
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-musl
target: toolchain
- name: amd64-musl:toolchain
<<: *buildTemplate
environment:
CTARGET: x86_64-multilib-linux-musl
target: toolchain
# Device targets
- name: arm64:tn48m
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: tn48m
- name: arm64:tn4810m
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: tn4810m
- name: arm64:tx4810
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: tx4810
- name: arm64:as5114-48x
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: as5114-48x
- name: arm64:rpi4:gentoo
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: rpi4
- name: arm64:rpi4:debian
<<: *buildTemplate
environment:
TARGET_DISTRO: debian
CTARGET: aarch64-unknown-linux-gnu
target: rpi4
- name: amd64:sn2010
<<: *buildTemplate
environment:
CTARGET: x86_64-multilib-linux-gnu
target: sn2010
- name: arm:ecw5211-l-t
<<: *buildTemplate
environment:
CTARGET: armv7a-unknown-linux-gnueabihf
target: ecw5211-l-t
- name: arm64:methode-udpu
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: methode-udpu
- name: arm64:cn9130-crb
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: cn9130-crb
- name: arm:clearfog-base
<<: *buildTemplate
environment:
CTARGET: armv7a-unknown-linux-gnueabihf
target: clearfog-base
- name: arm64:puzzle-m801
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: puzzle-m801
# Generic targets
- name: arm:vmlinux
<<: *buildTemplate
environment:
CTARGET: armv7a-unknown-linux-gnueabihf
target: vmlinux
- name: arm64:vmlinux
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: vmlinux
- name: amd64:vmlinux
<<: *buildTemplate
environment:
CTARGET: x86_64-multilib-linux-gnu
target: vmlinux
# System targets
- name: arm:system
<<: *buildTemplateNoOutput
environment:
CTARGET: armv7a-unknown-linux-gnueabihf
target: system
- name: arm64:system
<<: *buildTemplateNoOutput
environment:
CTARGET: aarch64-unknown-linux-gnu
target: system
- name: amd64:system
<<: *buildTemplateNoOutput
environment:
CTARGET: x86_64-multilib-linux-gnu
target: system
- name: arm-musl:system
<<: *buildTemplateNoOutput
environment:
CTARGET: armv7a-unknown-linux-musleabihf
target: system
- name: arm64-musl:system
<<: *buildTemplateNoOutput
environment:
CTARGET: aarch64-unknown-linux-musl
target: system
- name: amd64-musl:system
<<: *buildTemplateNoOutput
environment:
CTARGET: x86_64-multilib-linux-musl
target: system
# Package targets
- name: arm64:package
<<: *buildTemplate
environment:
CTARGET: aarch64-unknown-linux-gnu
target: package
PACKAGE: "sys-apps/ethtool"
# Transfer Artifacts
- name: transferArtifacts
<<: *artifactsTemplate
commands:
- echo -e $${DRONE_PASSWORD} | openssl base64 -A -d > ./key
- chmod 600 ./key
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentityFile=./key -r $(cat branchName) $${DRONE_USER}@$${DRONE_SERVER}:$${DRONE_DIRECTORY_PATH}
- name: transferReleases
<<: *artifactsTemplate
commands:
- echo -e $${DRONE_PASSWORD} | openssl base64 -A -d > ./key
- chmod 600 ./key
- cp -r $(cat branchName) $${DRONE_TAG}
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentityFile=./key -r $${DRONE_TAG} $${DRONE_USER}@$${DRONE_SERVER}:$${DRONE_RELEASES_PATH}
when:
event:
- tag
---
kind: signature
hmac: 5c3eedb9a6677169b5163e5acee8aa6b71abe2644a01b1983f1a2a297d5a0855
...