-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
728 lines (664 loc) · 22.3 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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
kind: pipeline
type: docker
name: pre-release
platform:
os: linux
arch: arm
trigger:
branch:
- release/*
event:
- tag
ref:
- refs/tags/v*-pre*
concurrency:
limit: 1
clone:
disable: true
services:
- name: launch-docker
image: arm32v7/docker:26.1.2-dind
privileged: true
network_mode: host
volumes:
- name: dockersock
path: /var/run
command: ['--insecure-registry=192.168.1.125:5000']
volumes:
- name: dockersock
temp: {}
steps:
- name: clone
image: 192.168.1.125:5000/cleep-git:20240923
commands:
- git clone $DRONE_REMOTE_URL cleep-dev
- ls -la
- cd cleep-dev
- git checkout $DRONE_SOURCE_BRANCH
- name: check-cleep-sources
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
privileged: true
commands:
- export CLEEP_ENV=ci
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- cleep-cli --version
- cd cleep-dev
- python3 -m pip install -r requirements.txt
- python3 -m pip freeze
- export REPO_DIR=/drone/src/cleep-dev
- # force all code to be updated from sources
- cleep-cli coresync
- cleep-cli cigetmods
- cleep-cli modssync --run-scripts
- # dry run
- cleep --noro --stdout --dryrun
- name: run-cleep-tests
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
privileged: true
commands:
- python3 -m pip -q --no-color install pip cleepcli coveralls --upgrade
- cleep-cli --version
- cd cleep-dev
- python3 -m pip install -r requirements-test.txt
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli coresync
- cleep-cli coretests --coverage --output
- cleep-cli coretestscov --xml --quiet
- name: export-coverage
image: 192.168.1.125:5000/cleep-codacy:20240318
network_mode: host
environment:
CODACY_PROJECT_TOKEN:
from_secret: codacy_project_token
commands:
- cd cleep-dev
- ls -la cleep/tests/
- curl -Ls -o codacy.sh https://coverage.codacy.com/get.sh
- bash codacy.sh report -r cleep/tests/coverage.xml
- name: build-cleep-deb
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
environment:
SENTRY_DSN:
from_secret: sentry_dsn
commands:
- apt-get -o Acquire::ForceIPv4=true -qq update
- apt-get -o Acquire::ForceIPv4=true -qq -y install python3 wget python3-distutils python3-dev devscripts python3-all python3-setuptools dh-python
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- cleep-cli --version
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli corebuild
- ls -la
- name: test-cleep-deb-install
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
commands:
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- # install cleep
- apt-get install --yes --fix-broken ./cleep_*_armhf.deb
- # force core modules to be updated from sources
- cleep-cli cigetmods
- cleep-cli modssync --run-scripts
- # dry run
- export CLEEP_ENV=ci
- cleep --noro --stdout --dryrun
- cleep --version > version.txt
- cat version.txt
- name: build-cleep-docker-image
image: 192.168.1.125:5000/cleep-utils:20240924
network_mode: host
privileged: true
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- echo "==> Drop docker image build for now (installed mandatory apps are not yet published)" && exit 0
- # MUST BE RAN AFTER test-cleep-install STEP to get version.txt file generated
- test -f version.txt || echo "No version.txt file found. Cannot continue"
- docker --version
- export VERSION=`cat version.txt`
- echo $VERSION
- cp -a "cleep_"$VERSION"_armhf.deb" "cleep-dev/cleep.deb"
- cd cleep-dev
- ls -la
- docker login 192.168.1.125:5000 --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- docker build -f Dockerfile -t 192.168.1.125:5000/cleep/cleep:$VERSION .
- # DO NOT PUSH IMAGE TO REGISTRY VOLONTARY
---
kind: pipeline
type: docker
name: release-candidate
platform:
os: linux
arch: arm
trigger:
branch:
- master
event:
- tag
ref:
- refs/tags/v*-rc*
concurrency:
limit: 1
clone:
disable: true
services:
- name: launch-docker
image: arm32v7/docker:26.1.2-dind
privileged: true
network_mode: host
volumes:
- name: dockersock
path: /var/run
command: ['--insecure-registry=192.168.1.125:5000']
volumes:
- name: dockersock
temp: {}
steps:
- name: clone
image: 192.168.1.125:5000/cleep-git:20240923
commands:
- git clone $DRONE_REMOTE_URL cleep-dev
- ls -la
- cd cleep-dev
- git checkout $DRONE_SOURCE_BRANCH
- name: check-cleep-sources
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
privileged: true
commands:
- export CLEEP_ENV=ci
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- cleep-cli --version
- cd cleep-dev
- python3 -m pip install -r requirements.txt
- python3 -m pip freeze
- export REPO_DIR=/drone/src/cleep-dev
- # force all code to be updated from sources
- cleep-cli coresync
- cleep-cli cigetmods
- cleep-cli modssync --run-scripts
- # dry run
- cleep --noro --stdout --dryrun
- name: run-cleep-tests
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
privileged: true
commands:
- echo $DRONE_COMMIT_MESSAGE
- >
[[ "$DRONE_COMMIT_MESSAGE" = *'[TESTS SKIP]'* ]] && echo "==> Stage dropped because commit message" && exit 0
- python3 -m pip -q --no-color install pip cleepcli coveralls --upgrade
- cleep-cli --version
- cd cleep-dev
- python3 -m pip install -r requirements-test.txt
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli coresync
- cleep-cli coretests --coverage --output
- cleep-cli coretestscov --xml --quiet
- name: export-coverage
image: 192.168.1.125:5000/cleep-codacy:20240318
network_mode: host
environment:
CODACY_PROJECT_TOKEN:
from_secret: codacy_project_token
commands:
- cd cleep-dev
- ls -la cleep/tests/
- curl -Ls -o codacy.sh https://coverage.codacy.com/get.sh
- bash codacy.sh report -r cleep/tests/coverage.xml
- name: build-cleep-deb
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
environment:
SENTRY_DSN:
from_secret: sentry_dsn
commands:
- apt-get -o Acquire::ForceIPv4=true -qq update
- apt-get -o Acquire::ForceIPv4=true -qq -y install python3 wget python3-distutils python3-dev devscripts python3-all python3-setuptools dh-python
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- cleep-cli --version
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli corebuild
- ls -la
- name: test-cleep-deb-install
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
commands:
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- # install cleep
- apt-get install --yes --fix-broken ./cleep_*_armhf.deb
- # force core modules to be updated from sources
- cleep-cli cigetmods
- cleep-cli modssync --run-scripts
- # dry run
- export CLEEP_ENV=ci
- cleep --noro --stdout --dryrun
- cleep --version > version.txt
- cat version.txt
- name: publish-cleep-docs
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
environment:
ID_ED25519:
from_secret: id_ed25519
ID_ED25519_PUB:
from_secret: id_ed25519_pub
commands:
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- # configure ssh
- mkdir -p ~/.ssh
- echo "$ID_ED25519" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- echo "$ID_ED25519_PUB" > ~/.ssh/id_ed25519.pub
- chmod 644 ~/.ssh/id_ed25519.pub
- ssh-keyscan github.com >> githubKey
- ssh-keygen -lf githubKey
- cat githubKey > ~/.ssh/known_hosts
- # configure git
- cd cleep-dev
- git config --global user.email "[email protected]"
- git config --global user.name "drone"
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli coredocs --publish
- name: build-cleep-docker-image
image: 192.168.1.125:5000/cleep-utils:20240924
network_mode: host
privileged: true
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- # MUST BE RAN AFTER test-cleep-install STEP to get version.txt file generated
- echo $DRONE_COMMIT_MESSAGE
- >
[[ "$DRONE_COMMIT_MESSAGE" = *'[DOCKER SKIP]'* ]] && echo "==> Stage dropped because commit message" && exit 0
- test -f version.txt || echo "No version.txt file found. Cannot continue"
- docker --version
- export VERSION=`cat version.txt`
- echo $VERSION
- cp -a "cleep_"$VERSION"_armhf.deb" "cleep-dev/cleep.deb"
- cd cleep-dev
- ls -la
- docker login 192.168.1.125:5000 --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- docker build -f Dockerfile -t 192.168.1.125:5000/cleep/cleep:$VERSION .
- docker push --quiet 192.168.1.125:5000/cleep/cleep:$VERSION
- name: update-app-ci-for-rc
image: 192.168.1.125:5000/cleep-git:20240923
network_mode: host
environment:
ID_ED25519:
from_secret: id_ed25519
ID_ED25519_PUB:
from_secret: id_ed25519_pub
commands:
- # configure ssh
- mkdir -p ~/.ssh
- echo "$ID_ED25519" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- echo "$ID_ED25519_PUB" > ~/.ssh/id_ed25519.pub
- chmod 644 ~/.ssh/id_ed25519.pub
- ssh-keyscan github.com >> githubKey
- ssh-keygen -lf githubKey
- cat githubKey > ~/.ssh/known_hosts
- # configure git
- git config --global user.email "[email protected]"
- git config --global user.name "drone"
- # update cleep-ci
- export VERSION=`cat version.txt`
- echo $VERSION
- git clone [email protected]:CleepDevice/cleep-ci.git
- cd cleep-ci
- echo $VERSION > .cleep-rc-version.txt
- ./generate-drone-app-yml.sh
- git add .drone-app.yml .cleep-rc-version.txt
- git commit -m "Update Cleep "$VERSION" release candidate" | true
- git push -u origin HEAD | true
- # keep latest release
- export FREEZED_VERSION=`cat .cleep-rc-version.txt`
- cd ..
- rm -rf cleep-ci
- echo $FREEZED_VERSION > freezed_version.txt
- name: freeze-markets
image: 192.168.1.125:5000/cleep-git:20240923
environment:
ID_ED25519:
from_secret: id_ed25519
ID_ED25519_PUB:
from_secret: id_ed25519_pub
commands:
- # MUST BE EXECUTED AFTER update-app-ci-for-rc STEP
- test -f freezed_version.txt || echo "No freezed_version.txt file found. Cannot continue"
- # configure ssh
- mkdir -p ~/.ssh
- echo "$ID_ED25519" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- echo "$ID_ED25519_PUB" > ~/.ssh/id_ed25519.pub
- chmod 644 ~/.ssh/id_ed25519.pub
- ssh-keyscan github.com >> githubKey
- ssh-keygen -lf githubKey
- cat githubKey > ~/.ssh/known_hosts
- # configure git
- git config --global user.email "[email protected]"
- git config --global user.name "drone"
- # get version
- export VERSION=`cat version.txt`
- echo $VERSION
- # TODO use cleep-ci to freeze configured markets
- # freeze version on cleep-apps
- git clone [email protected]:CleepDevice/cleep-apps.git
- cd cleep-apps
- export TAG_EXISTS=`git tag --list "v"$VERSION | wc -l`
- >
[ $TAG_EXISTS -eq 0 ] && git tag "v"$VERSION && git push --tags || true
- cd ..
- # freeze version on cleep-apps-nonfree
- git clone [email protected]:CleepDevice/cleep-apps-nonfree.git
- cd cleep-apps-nonfree
- export TAG_EXISTS=`git tag --list "v"$VERSION | wc -l`
- >
[ $TAG_EXISTS -eq 0 ] && git tag "v"$VERSION && git push --tags || true
- name: publish-cleep-deb
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
privileged: true
environment:
GITHUB_ACCESS_TOKEN:
from_secret: github_access_token
commands:
- # MUST BE RAN AFTER test-cleep-install STEP to get version.txt file generated
- test -f version.txt || echo "No version.txt file found. Cannot continue"
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- export VERSION=`cat version.txt`
- echo "version=$VERSION" "tag=$DRONE_TAG"
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli corepublish --version=$VERSION --prerelease --tag=$DRONE_TAG
---
kind: pipeline
type: docker
name: release
platform:
os: linux
arch: arm
trigger:
branch:
- master
event:
- tag
ref:
include:
- refs/tags/v*
exclude:
- refs/tags/v*-pre*
- refs/tags/v*-rc*
- refs/tags/v*-cleepos*
concurrency:
limit: 1
clone:
disable: true
services:
- name: launch-docker
image: arm32v7/docker:26.1.2-dind
privileged: true
network_mode: host
volumes:
- name: dockersock
path: /var/run
command: ['--insecure-registry=192.168.1.125:5000']
volumes:
- name: dockersock
temp: {}
steps:
- name: clone
image: 192.168.1.125:5000/cleep-git:20240923
commands:
- git clone $DRONE_REMOTE_URL cleep-dev
- ls -la
- cd cleep-dev
- git checkout $DRONE_SOURCE_BRANCH
- name: check-cleep-sources
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
privileged: true
commands:
- export CLEEP_ENV=ci
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- cleep-cli --version
- cd cleep-dev
- python3 -m pip install -r requirements.txt
- python3 -m pip freeze
- export REPO_DIR=/drone/src/cleep-dev
- # force all code to be updated from sources
- cleep-cli coresync
- cleep-cli cigetmods
- cleep-cli modssync --run-scripts
- # dry run
- cleep --noro --stdout --dryrun
- name: run-cleep-tests
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
privileged: true
commands:
- python3 -m pip -q --no-color install pip cleepcli coveralls --upgrade
- cleep-cli --version
- cd cleep-dev
- python3 -m pip install -r requirements-test.txt
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli coresync
- cleep-cli coretests --coverage --output
- cleep-cli coretestscov --xml --quiet
- name: export-coverage
image: 192.168.1.125:5000/cleep-codacy:20240318
network_mode: host
environment:
CODACY_PROJECT_TOKEN:
from_secret: codacy_project_token
commands:
- cd cleep-dev
- ls -la cleep/tests/
- curl -Ls -o codacy.sh https://coverage.codacy.com/get.sh
- bash codacy.sh report -r cleep/tests/coverage.xml
- name: build-cleep-deb
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
environment:
SENTRY_DSN:
from_secret: sentry_dsn
commands:
- apt-get -o Acquire::ForceIPv4=true -qq update
- apt-get -o Acquire::ForceIPv4=true -qq -y install python3 wget python3-distutils python3-dev devscripts python3-all python3-setuptools dh-python
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- cleep-cli --version
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli corebuild
- ls -la
- name: test-cleep-deb-install
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
commands:
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- # install cleep
- apt-get install --yes --fix-broken ./cleep_*_armhf.deb
- # force core modules to be updated from sources
- cleep-cli cigetmods
- cleep-cli modssync --run-scripts
- # dry run
- export CLEEP_ENV=ci
- cleep --noro --stdout --dryrun
- cleep --version > version.txt
- cat version.txt
- name: publish-cleep-api-docs
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
environment:
ID_ED25519:
from_secret: id_ed25519
ID_ED25519_PUB:
from_secret: id_ed25519_pub
commands:
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- # configure ssh
- mkdir -p ~/.ssh
- echo "$ID_ED25519" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- echo "$ID_ED25519_PUB" > ~/.ssh/id_ed25519.pub
- chmod 644 ~/.ssh/id_ed25519.pub
- ssh-keyscan github.com >> githubKey
- ssh-keygen -lf githubKey
- cat githubKey > ~/.ssh/known_hosts
- # configure git
- cd cleep-dev
- git config --global user.email "[email protected]"
- git config --global user.name "drone"
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli coredocs --publish
- name: build-cleep-docker-image
image: 192.168.1.125:5000/cleep-utils:20240924
network_mode: host
privileged: true
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- # MUST BE RAN AFTER test-cleep-install STEP to get version.txt file generated
- test -f version.txt || echo "No version.txt file found. Cannot continue"
- docker --version
- export VERSION=`cat version.txt`
- echo $VERSION
- cp -a "cleep_"$VERSION"_armhf.deb" "cleep-dev/cleep.deb"
- cd cleep-dev
- ls -la
- docker login 192.168.1.125:5000 --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- docker build -f Dockerfile -t 192.168.1.125:5000/cleep/cleep:$VERSION .
- docker push 192.168.1.125:5000/cleep/cleep:$VERSION
- name: publish-cleep-deb
image: 192.168.1.125:5000/cleep-build/bullseye:20231205
network_mode: host
privileged: true
environment:
GITHUB_ACCESS_TOKEN:
from_secret: github_access_token
commands:
- # MUST BE RAN AFTER test-cleep-install STEP to get version.txt file generated
- test -f version.txt || echo "No version.txt file found. Cannot continue"
- python3 -m pip -q --no-color install pip cleepcli --upgrade
- export VERSION=`cat version.txt`
- echo "version=$VERSION" "tag=$DRONE_TAG"
- export REPO_DIR=/drone/src/cleep-dev
- cleep-cli corepublish --version=$VERSION --tag=$DRONE_TAG
---
kind: pipeline
type: docker
name: release-cleepos
platform:
os: linux
arch: amd64
trigger:
branch:
- master
event:
- tag
ref:
- refs/tags/v*-cleepos*
concurrency:
limit: 1
clone:
disable: true
volumes:
- name: dev
host:
path: /dev
steps:
- name: clone
image: 192.168.1.1:8662/cleep-git:20240927
commands:
- git clone $DRONE_REMOTE_URL cleep-dev
- ls -la
- cd cleep-dev
- git checkout $DRONE_SOURCE_BRANCH
- name: prepare-cleepos-image
image: 192.168.1.1:8662/cleep-git:20240927
network_mode: host
environment:
ID_ED25519:
from_secret: id_ed25519
ID_ED25519_PUB:
from_secret: id_ed25519_pub
commands:
- # get version from tag
- echo "DRONE_TAG="$DRONE_TAG
- echo $DRONE_TAG | awk -F "-" '{ print substr($1,2) }' > version.txt
- export VERSION=`cat version.txt`
- echo $VERSION
- # configure ssh
- mkdir -p ~/.ssh
- echo "$ID_ED25519" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- echo "$ID_ED25519_PUB" > ~/.ssh/id_ed25519.pub
- chmod 644 ~/.ssh/id_ed25519.pub
- ssh-keyscan github.com >> githubKey
- ssh-keygen -lf githubKey
- cat githubKey > ~/.ssh/known_hosts
- rm githubKey
- # get cleep-packer files
- git clone [email protected]:CleepDevice/cleep-packer.git
- cp version.txt cleep-packer/.
- cd cleep-packer
- ./generate-cleepos-lite-arm-json.sh
- head -n 4 cleepos-lite-arm.json
- name: build-cleepos-image
image: mkaczanowski/packer-builder-arm:1.0.9
network_mode: host
privileged: true
volumes:
- name: dev
path: /dev
commands:
- # enable packer for arm (see https://github.com/mkaczanowski/packer-builder-arm/blob/master/docker/entrypoint.sh)
- mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
- find /proc/sys/fs/binfmt_misc -type f -name 'qemu-*' -exec sh -c 'echo -1 > "$1"' shell {} \;
- uname -m
- echo "Register qemu-aarch64"
- echo ":qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:F" > /proc/sys/fs/binfmt_misc/register
- echo "Register qemu-arm"
- echo ":qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:F" > /proc/sys/fs/binfmt_misc/register
- # run packer
- cd cleep-packer
- export VERSION=`cat version.txt`
- echo $VERSION
- packer build cleepos-lite-arm.json
- ls -lh
- mv "cleepos_"$VERSION".zip" ../.
- mv "cleepos_"$VERSION".sha256" ../.
- cd ..
- rm -rf cleep-packer
- ls -lh
- name: publish-cleepos-image
image: 192.168.1.1:8662/cleep-utils:20240927
network_mode: host
environment:
GITHUB_ACCESS_TOKEN:
from_secret: github_access_token
commands:
- ls -lh
- export VERSION=`cat version.txt`
- echo $VERSION
- CHANGELOG=`realpath cleep-dev/debian/changelog`
- github-helper publishcleepos --owner=CleepDevice --repo=cleep-os --archive="cleepos_"$VERSION".zip" --sha256="cleepos_"$VERSION".sha256" --version=$VERSION --changelog=$CHANGELOG --token=$GITHUB_ACCESS_TOKEN