-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
executable file
·1078 lines (1050 loc) · 43.1 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
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
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
variables:
DEFAULT_CONF: k230_canmv_defconfig
HW_VER: v0.1
TFTP_BASE: /data1/tftp_server
NFS_BASE: /data/nfs_server
NFS_SERVER: 10.10.1.94
GITLAB_REPO: [email protected]:maix_sw/k230_canmv.git
GITHUB_REPO: [email protected]:kendryte/k230_canmv.git
GITEE_REPO: [email protected]:kendryte/k230_canmv.git
TEST_SCRIPTS_REPO: [email protected]:maix_sw/k230_canmv_testscripts.git
default:
image: ai.b-bug.org:5000/k230_sdk:latest
tags:
- k230_sdk
# interruptible: true
stages:
- build_setup
- build_src
- smoke_test
- test
- publish
- send_msg
# MR merged
main_release:
stage: publish
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
variables:
BRANCH: main
extends:
- .sync_github_gitee
# tag push
tag_release:
stage: publish
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
variables:
BRANCH: main
extends:
- .sync_github_gitee
# schedule daily build sync
dev_release:
stage: publish
rules:
# daily build
- if: $CI_PIPELINE_SOURCE == "schedule"
variables:
BRANCH: dev
extends:
- .sync_github_gitee
# schedule daily build sync and release sync
download_dir_release:
stage: publish
rules:
# daily build
- if: $CI_PIPELINE_SOURCE == "schedule"
# release
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
extends:
- .release_download_dir
# sdk image publish with tag
release_image_publish:
stage: publish
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
parallel:
matrix:
- CONF:
- k230_canmv_defconfig
- k230d_canmv_only_rtt_defconfig
- k230_canmv_01studio_defconfig
extends:
- .sync_release_image
.sync_github_gitee:
timeout: 30m
retry: 2
script:
- cd $CI_PROJECT_DIR
- ls -alht
- rm -rf ./k230_canmv/
- git clone ${GITLAB_REPO} k230_canmv || exit 1
- cd k230_canmv || exit 1
- pwd
- git checkout ${BRANCH}
- git branch -a
- git status
- echo '---pull latest ${BRANCH} branch---'
- timeout 1m git pull origin ${BRANCH} || { echo "timeout matched">&2; sleep 15; timeout 1m git pull origin ${BRANCH} || { echo "timeout2 matched,">&2; timeout 1m git pull origin ${BRANCH}; exit 1; } }
- echo '---fetch all tags---'
- timeout 1m git fetch --tags || { echo "timeout matched">&2; sleep 15; timeout 1m git fetch --tags || { echo "timeout2 matched,">&2; timeout 1m git fetch --tags; exit 1; } }
- git remote add github ${GITHUB_REPO}
- git remote add gitee ${GITEE_REPO}
- git remote -v
- git branch -a
- git status
- echo "---push to gitee---"
- timeout 3m git push --atomic --tags -u -f gitee ${BRANCH} || { echo "timeout matched">&2; sleep 15; timeout 3m git push --atomic --tags -u -f gitee ${BRANCH} || { echo "timeout2 matched,">&2; timeout 3m git push --atomic --tags -u -f gitee ${BRANCH}; exit 1; } }
- echo "---push to github---"
- timeout 3m git push --atomic --tags -u -f github ${BRANCH} || { echo "timeout matched">&2; sleep 15; timeout 3m git push --atomic --tags -u -f github ${BRANCH} || { echo "timeout2 matched,">&2; git push --atomic --tags -u -f github ${BRANCH}; exit 1; } }
.release_download_dir:
timeout: 60m
retry: 2
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/release/release_download_dir.sh -O ./release_download_dir.sh
- chmod +x ./release_download_dir.sh
- time ./release_download_dir.sh || time ./release_download_dir.sh
- echo "all file synced"
.sync_release_image:
timeout: 60m
retry: 2
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/release/release_k230_canmv_image.sh -O ./release_k230_canmv_image.sh
- chmod +x ./release_k230_canmv_image.sh
- echo $CI_COMMIT_TAG || exit 1
- echo $CONF || exit 1
- time ./release_k230_canmv_image.sh $CI_COMMIT_TAG $CONF || time ./release_k230_canmv_image.sh $CI_COMMIT_TAG $CONF
- echo "all release file synced"
.show_vars: &show_vars
- echo "${JOB_TYPE}"
- echo "${DST_BASE}"
- echo "${SUB_BASE}"
- echo "${sysimage_path}"
- echo "${sysimage_md5}"
- echo "${image_url}"
- echo "${image_path}"
- echo "${BUILD}"
.get_job_result: &get_job_result
- |
echo "CI_PROJECT_NAME $CI_PROJECT_NAME"
echo "CI_JOB_NAME $CI_JOB_NAME"
echo "CI_JOB_STATUS $CI_JOB_STATUS"
echo "CI_JOB_ID $CI_JOB_ID"
echo "CI_JOB_IMAGE $CI_JOB_IMAGE"
echo "CI_JOB_NAME_SLUG $CI_JOB_NAME_SLUG"
echo "CI_JOB_STAGE $CI_JOB_STAGE"
echo "CI_JOB_TIMEOUT $CI_JOB_TIMEOUT"
echo "CI_JOB_URL $CI_JOB_URL"
echo "CI_PIPELINE_SOURCE $CI_PIPELINE_SOURCE"
echo "CI_PIPELINE_URL $CI_PIPELINE_URL"
echo "CI_PIPELINE_NAME $CI_PIPELINE_NAME"
echo "CI_PIPELINE_TRIGGERED $CI_PIPELINE_TRIGGERED"
echo "check send feishu msg to group"
SEND="FALSE"
if [[ "$CI_PIPELINE_SOURCE" != "merge_request_event" ]]; then
if [[ "$CI_JOB_STATUS" == "success" ]]; then
echo "job pass, check again"
if [[ "$CI_JOB_STAGE" == "send_msg" ]]; then
echo "match the last test, will send feishu pass msg"
SEND="TRUE"
else
echo "job pass but not the last one, continue the next job"
fi
elif [[ "$CI_JOB_STATUS" == "failed" ]]; then
echo "job failed, will send feishu msg now"
SEND="TRUE"
else
echo "unknown job status"
fi
else
echo "skip feishu msg for MR event"
fi
echo "Pipeline created at $CI_PIPELINE_CREATED_AT"
total_seconds=$(($(date +%s) - $(date -d $CI_PIPELINE_CREATED_AT +%s)))
echo "Total pipeline duration ${total_seconds} seconds"
t_hours=$((total_seconds / 3600))
t_minutes=$(( (total_seconds % 3600) / 60 ))
t_seconds=$((total_seconds % 60))
echo "Total pipeline duration ${t_hours}小时${t_minutes}分${t_seconds}秒"
if [[ "$SEND" == "TRUE" ]];
then
test -d bin || mkdir ./bin;
test -f ./bin/send_feishu && rm -rf ./bin/send_feishu;
echo "start to download send_feishu";
wget -qc https://ai.b-bug.org/k230/test_resources/ci/tools/send_feishu -O ./bin/send_feishu;
chmod +x ./bin/send_feishu;
echo "---start to send feishu msg in for loop"
stime=$(date +'%Y-%m-%d %H:%M:%S')
echo "---run send feishu msg start time: $stime"
send_cmd="timeout 1m ./bin/send_feishu --msg_type pipeline --gitlab_repo $CI_PROJECT_NAME --pipeline_source $CI_PIPELINE_SOURCE --pipeline_version ${SUB_BASE} --pipeline_seconds $total_seconds --pipeline_stage $CI_JOB_STAGE --pipeline_url $CI_PIPELINE_URL --pipeline_result $CI_JOB_STATUS --sdk_url '$sdk_url' --image_url '$image_url' --job_name='$CI_JOB_NAME'"
for i in {1..5}; do
if [ $i -eq 5 ]
then
echo "ERROR: Max retries reached with run send feishu msg"
exit 1
fi
starttime=$(date +'%Y-%m-%d %H:%M:%S')
echo "---loop $i start time: $starttime"
echo "`date +'%Y-%m-%d %H:%M:%S'` use curl to test feishu server start"
timeout 1m curl -X POST -H 'Content-Type: application/json' --data '{"username":"xyz","password":"xyz"}' https://open.feishu.cn/open-apis/bot/v2/hook/44335978-407b-44c5-99d1-954934b3caa4 -v
echo "`date +'%Y-%m-%d %H:%M:%S'` use curl to test feishu server end"
echo "---start to run send feishu msg in loop $i---"
if eval $send_cmd
then
echo "---loop $i run send feishu msg pass---"
break
else
echo "ERROR:loop $i run send feishu msg failed, ignore Error and try again..."
echo "---start to rerun in next loop..."
sleep 3
fi
endtime=$(date +'%Y-%m-%d %H:%M:%S')
start_seconds=$(date -d "$starttime" +%s)
end_seconds=$(date -d "$endtime" +%s)
echo "---loop $i end time: $endtime"
echo "---loop $i total cost time:$((end_seconds - start_seconds)) s"
done
etime=$(date +'%Y-%m-%d %H:%M:%S')
s_seconds=$(date -d "$stime" +%s)
e_seconds=$(date -d "$etime" +%s)
echo "---run send feishu msg end time: $etime"
echo "---run send feishu msg total cost time:$((e_seconds - s_seconds)) s"
echo "---finished run send feishu msg in loop $i"
echo "send feishu done";
else
echo "skip send feishu msg";
fi
.get_job_type: &get_job_type
- echo "----------get dst dir with job type----------"
- |
echo "check job from MR or tag or schedule or web"
if [[ $CI_PIPELINE_SOURCE == "merge_request_event" ]]; then
echo "current job is MR"
JOB_TYPE="merge_request"
DST_BASE="/data1/k230/gitlab-ci/images/${CI_PROJECT_NAME}"
elif [[ $CI_PIPELINE_SOURCE == "schedule" ]]; then
echo "current job is daily build schedule job"
JOB_TYPE="daily_build"
DST_BASE="/data1/k230/dev-release"
elif [[ $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_TAG =~ ^v[0-9]+\.[0-9]+.*$ ]]; then
echo "current job is pre release job"
JOB_TYPE="pre_release"
DST_BASE="/data1/k230/pre-release"
elif [[ $CI_PIPELINE_SOURCE == "web" ]]; then
echo "current job is manual test job"
JOB_TYPE="manual_test"
DST_BASE="/data1/k230/gitlab-ci/images/${CI_PROJECT_NAME}"
elif [[ $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ ^v[0-9]+\.[0-9]+.*$ ]]; then
echo "current job is release job"
JOB_TYPE="release"
DST_BASE="/data1/k230/release"
else
echo "current job is not define, EXIT with ERROR"
exit 1
fi
- echo ${JOB_TYPE}
- echo ${DST_BASE}
- echo "----------get dst dir job done----------"
.generate_version: &generate_version
- echo "----------generate version----------"
- echo "generate version with tag or commit id"
- >
if [[ $CI_COMMIT_TAG =~ ^v[0-9]+\.[0-9]+.*$ ]];
then
echo "tag exist, version should be tag";
new_ver=$CI_COMMIT_TAG;
echo "tag is ${new_ver}";
else
echo "tag is null, version should be commit id";
commitid="unkonwn";
latest_tag="unkonwn";
git rev-parse --short HEAD && commitid=$(git rev-parse --short HEAD);
git describe --tags `git rev-list --tags --max-count=1` && latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`);
cur_date=$(date "+%Y%m%d-%H%M%S") || exit 1;
new_ver="${latest_tag}-${cur_date}-$(whoami)-$(hostname)-${commitid}" || exit 1;
echo "ver is ${new_ver}";
fi
- echo ${new_ver} > version || exit 1
- cat version || exit 1
.latest_version: &latest_version
- echo "check latest commit id for daily build"
- >
if [[ "${JOB_TYPE}" == "daily_build" ]]; then
echo "current job is daily_build, check commit id"
cur_commitid=$(git rev-parse --short HEAD)
echo "get latest commit id"
if [ -d "${DST_BASE}/canmv/latest/"]; then
latest_file=$(ls "${DST_BASE}/canmv/latest/")
finished_commitid=$(echo $latest_file | sed "s/.*-gitlab-runner-\(.*\)\.tar\.gz/\1/g")
else
finished_commitid=""
fi
echo "current commit_id $cur_commitid"
echo "finished commit_id $finished_commitid"
if [[ "$cur_commitid" == "$finished_commitid" ]]; then
echo "WARNNING current commit id is equal to finished commit id";
echo "There is no any code changes, SKIP and EXIT";
echo "BUILD=False" > build.env;
exit 0;
else
echo "current commit id is NOT equal to finished commit id, will continue to run build job";
fi
else
echo "current job is NOT daily build, will continue to run build job";
fi
.build_job: &build_job
- pwd
- echo "----------update folder owner----------"
- ls -alht micropython
- ls -alht k230_sdk
- cur_user=$(id -u)
- cur_group=$(id -g)
- sudo chown -R ${cur_user}:${cur_group} ./micropython
- sudo chown -R ${cur_user}:${cur_group} ./k230_sdk
- ls -alht micropython
- ls -alht k230_sdk
- echo "----------skip toolchain download in local docker----------"
- mkdir toolchain && touch toolchain/.toolchain_ready
- time make prepare_sourcecode || exit 1
- time make CONF=${CONF} || exit 1
- echo "----------show sdk image build output----------"
- pwd
- du -h -d 2 output/${CONF}/ || exit 1
- ls -alht output/${CONF}/images || exit 1
- echo "----------remove duplicate img----------"
- rm -rf output/${CONF}/images/sysimage-sdcard.img
#- rm -rf output/${CONF}/images/sysimage-spinand32m.img
#- rm -rf output/${CONF}/images/sysimage-spinor32m.img
- echo "----------remove big-core/little-core ----------"
- cd output/${CONF}/images/ && pwd
#- tar -zcf big-core.tgz ./big-core/
#- tar -zcf little-core.tgz ./little-core/
- rm -rf ./big-core/
- rm -rf ./little-core/
- cd ../../../ && pwd
- echo "----------build sdk image done----------"
.check_build_result: &check_build_result
- date
- >
if [[ "${BUILD}" == "False" ]];
then
echo "WARNNING: current commit id is equal to finished commit id";
echo "There is no any code changes, SKIP test job and quit"
exit 0;
else
echo "----------start to run test job----------";
fi
.common:
build_image:
- cd $CI_PROJECT_DIR
- echo "----------build image----------"
- *build_job
- echo "----------set test-image flag----------"
- echo "BUILD=True" > build.env
- echo "save default config name for next job"
- echo "conf=${CONF}" >> build.env
- cat $CI_PROJECT_DIR/build.env || exit 1
save_image:
- pwd
- echo "----------save image----------"
- echo ${DST_BASE}
- echo ${SUB_BASE}
- echo "set DST_DIR with different type based on docs/images/src"
- DST_DIR="${DST_BASE}/canmv"
- echo ${DST_DIR}
- echo "---create repo dir---"
- sudo mkdir -p ${DST_DIR}
- echo "----------Save build to external path----------"
- SUB_DIR="${SUB_BASE}/${CONF}";
- echo "---create current image version dir---"
- sudo mkdir -p ${DST_DIR}/${SUB_DIR}/ || exit 1
- echo "---save sdk build output---"
- sudo cp -rf --sparse=always ${SRC_DIR}/ ${DST_DIR}/${SUB_DIR}/
- echo "${DST_DIR}/${SUB_DIR}/"
- |
echo "check linux and rtsmart should be enable at the same time to cp mpp/cdk demo"
config_rtsmart=$(cat ./configs/${CONF} | grep 'CONFIG_SUPPORT_RTSMART=y' || true)
config_linux=$(cat ./configs/${CONF} | grep 'CONFIG_SUPPORT_LINUX=y' || true)
if [[ -n "$config_rtsmart" ]] && [[ -n "$config_linux" ]];
then
sudo mkdir -p ${DST_DIR}/${SUB_DIR}/sdk_testcase/ || exit 1
echo "---save sdk testcase output---"
mkdir -p sdk_testcase/app_demo/
cp -rf --sparse=always ./src/big/mpp/userapps/sample/elf/* ./sdk_testcase/app_demo/
cp -rf --sparse=always ./src/common/cdk/user/out/big/* ./sdk_testcase/app_demo/
tree ./sdk_testcase/
echo "---compress sdk_testcase dir---"
tar -zcf k230_testcase_${SUB_BASE}.tar.gz ./sdk_testcase/ || exit 1
echo "---save zip file---"
sudo cp -rf --sparse=always k230_testcase_${SUB_BASE}.tar.gz ${DST_DIR}/${SUB_DIR}/sdk_testcase/
else
echo "current config only support linux or only support rtsmart ,skip cp mpp/cdk demo"
fi
- echo "${DST_DIR}/${SUB_DIR}/"
- ls "${DST_DIR}/${SUB_DIR}/"
- echo "add latest link for current build"
- test -h ${DST_DIR}/latest && sudo rm ${DST_DIR}/latest || { test -h ${DST_DIR}/latest && sudo rm ${DST_DIR}/latest; }
- sudo ln -s ${DST_DIR}/${SUB_BASE} ${DST_DIR}/latest || exit 1
- echo "----------save image done----------"
- image_path="${DST_DIR}/${SUB_BASE}/"
- echo "image_path=${image_path}" >> $CI_PROJECT_DIR/build.env
- image_url=$(echo ${image_path} | sed 's/\/data1/https:\/\/ai\.b-bug\.org/g')
- echo "image_url=${image_url}" >> $CI_PROJECT_DIR/build.env
- cat $CI_PROJECT_DIR/build.env || exit 1
- echo "----------image output----------"
- echo "${image_path}"
- echo "${image_url}"
save_tftp:
- pwd
- echo "----------save image to tftp----------"
- >
if [[ "${CONF}" == "${DEFAULT_CONF}" ]];
then
echo "start to save test image for default config: ${CONF} ------"
echo ${TFTP_BASE} || exit 1
echo "set DST_DIR with different type based on docs/images/src"
DST_DIR="${TFTP_BASE}/${HW_TYPE}/${HW_MODEL}_${HW_VER}"
echo ${DST_DIR}
echo "---create tftp dir---"
sudo mkdir -p ${DST_DIR} || exit 1
echo "generate sub dir for MR/Pre-releae/relese job"
echo "check job from MR or tag or schedule or web"
if [[ ${CI_MERGE_REQUEST_IID} ]]; then
echo "current job is MR, skip and use CI_MERGE_REQUEST_IID"
elif [[ ${CI_COMMIT_TAG} ]]; then
echo "current job is release job, use CI_COMMIT_TAG"
CI_MERGE_REQUEST_IID=${CI_COMMIT_TAG}
elif [[ $CI_PIPELINE_SOURCE == "schedule" ]]; then
echo "current job is daily build schedule job, use CI_PIPELINE_SOURCE"
CI_MERGE_REQUEST_IID=$CI_PIPELINE_SOURCE
else
echo "current job is not match, use CI_PIPELINE_SOURCE"
CI_MERGE_REQUEST_IID=$CI_PIPELINE_SOURCE
fi
echo "current MR ID ${CI_MERGE_REQUEST_IID}"
SUB_DIR="${CI_MERGE_REQUEST_IID}_${CI_PIPELINE_ID}/${CONF}";
sudo mkdir -p ${DST_DIR}/${SUB_DIR}/ || exit 1
src_file="${SRC_DIR}/sysimage-sdcard.img.gz"
ls "${src_file}" || exit 1
sysimage_md5=$(md5sum ${src_file} | awk '{print $1}')
echo "sysimage md5 is ${sysimage_md5}"
sudo cp -rf --sparse=always ${src_file} ${DST_DIR}/${SUB_DIR}/
echo "${DST_DIR}/${SUB_DIR}/"
ls -alht "${DST_DIR}/${SUB_DIR}/" || exit 1
echo "release job works in release_sdk sub dir, use full path"
echo "sysimage_path=${DST_DIR}/${SUB_DIR}/sysimage-sdcard.img.gz" >> $CI_PROJECT_DIR/build.env
echo "sysimage_md5=${sysimage_md5}" >> $CI_PROJECT_DIR/build.env
ls
cat $CI_PROJECT_DIR/build.env
else
echo "SKIP save test image for current config: ${CONF}------"
fi
- echo "----------save image to tftp done----------"
.test:
test_setup:
- - echo "----------Step 1. get available test devices----------"
- |
echo "check job from MR or tag or schedule or web"
if [[ ${CI_MERGE_REQUEST_IID} ]]; then
echo "current job is MR, skip and use CI_MERGE_REQUEST_IID"
elif [[ ${CI_COMMIT_TAG} ]]; then
echo "current job is release job, use CI_COMMIT_TAG"
CI_MERGE_REQUEST_IID=${CI_COMMIT_TAG}
elif [[ $CI_PIPELINE_SOURCE == "schedule" ]]; then
echo "current job is daily build schedule job, use CI_PIPELINE_SOURCE"
CI_MERGE_REQUEST_IID=$CI_PIPELINE_SOURCE
else
echo "current job is not match, use CI_PIPELINE_SOURCE"
CI_MERGE_REQUEST_IID=$CI_PIPELINE_SOURCE
fi
- echo "MR ID ${CI_MERGE_REQUEST_IID}"
- echo "Pipeline ID ${CI_PIPELINE_ID}"
- test -d bin || mkdir ./bin
- test -f ./bin/ailab && rm -rf ./bin/ailab
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/tools/ailab -O ./bin/ailab
- chmod +x ./bin/ailab
- |
echo "for loop to get available test device"
for i in {1..6}; do
if [ $i -eq 6 ];
then
echo "ERROR: No Available DUT after 5 times retry, Please rerun curent job to check it again";
exit 1;
fi
starttime=$(date +'%Y-%m-%d %H:%M:%S');
echo "---loop $i start time: $starttime";
echo "---start to get available test device in loop $i---";
available=$(./bin/ailab show --dest available --domain ${TEST_ENV} --hw_type ${HW_TYPE} --hw_model ${HW_MODEL} --hw_ver ${HW_VER} --format args)
echo ${available}
if [[ $available =~ "k230" ]];
then
echo "---Get Available DUT pass in loop $i---";
echo "----------get available test devices done----------";
echo "----------Step 2. reserve test device----------";
reserved=$(./bin/ailab add ${available} --time 15m --site ${CI_PROJECT_NAME} --source ${CI_MERGE_REQUEST_IID} --job ${CI_PIPELINE_ID} --format args);
echo ${reserved};
if [[ ${reserved} =~ "gitlab" ]];
then
echo "Reserve DUT pass in loop $i, break loop and continue the next job";
# exit for loop with break once device avaiable and reserved pass
break;
else
echo "ERROR: Reserve DUT failed";
if [ $i -eq 6 ];
then
echo "ERROR: No Available DUT after 5 times retry, Please rerun curent job to check it again";
exit 1;
else
echo "---sleep 30 seconds and auto rerun in next loop...";
sleep 30
fi
fi
else
echo "ERROR: Get available test device failed in loop $i, ignore Error and try again...";
echo "---sleep for 30seconds and start to rerun in next loop...";
sleep 30;
fi
done
- echo "----------Step 3. save reserved/available for after_script----------"
- echo "${available}" > available
- echo "${reserved}" > reserved
- echo "${HW_MODEL}" > HW_MODEL
- echo "----------Step 4. power on/reset test device before test start----------"
- power_off="./bin/ailab power --type=off ${available}";
- power_on="./bin/ailab power --type=on ${available}";
- power_reset="./bin/ailab power --type=cycle ${available}";
- echo $power_off
- echo $power_on
- echo $power_reset
- |
echo "---start to run device power job before test start...";
if [[ "$HW_MODEL" =~ "canmv_v2" ]]
then
echo "---canmv v2 board will be power reset at test start ---";
$power_reset;
sleep 2;
echo "canmv_v2 board power reset done. continue to run test job";
elif [[ "$HW_MODEL" == "canmv" ]]
then
echo "---canmv board will be power reset at test start ---";
$power_reset;
sleep 2;
echo "canmv board power reset done. continue to run test job";
else
echo "---evb board will be power off and power on at test start---";
$power_off;
sleep 2;
$power_on;
sleep 2;
echo "evb board power off and power on done. continue in next loop";
fi
echo "---device power action done, start to run test job...";
- echo "----------reserve test device and power on/reset test device done----------"
test_teardown:
- echo "----------release test device----------"
- echo "get variables from previous steps"
- reserved=$(cat reserved)
- available=$(cat available)
- HW_MODEL=$(cat HW_MODEL)
- echo "Release DUT start"
- test -d bin || mkdir ./bin
- test -f ./bin/ailab && rm -rf ./bin/ailab
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/tools/ailab -O ./bin/ailab
- chmod +x ./bin/ailab
- result=$(./bin/ailab update --dest=reserved ${reserved})
- echo $result
- echo $result
- |
if [[ $result =~ "True" ]]; then
echo "Release DUT pass";
else
echo "ERROR: Release DUT failed";
exit 1;
fi
- power_off="./bin/ailab power --type=off ${available}";
- power_on="./bin/ailab power --type=on ${available}";
- power_reset="./bin/ailab power --type=cycle ${available}";
- echo $power_off
- echo $power_on
- echo $power_reset
- |
echo "---start to run device power job after test done...";
if [[ "$HW_MODEL" =~ "canmv_v2" ]]
then
echo "---canmv v2 board will skip power job at test start ---";
# $power_reset;
# sleep 2;
# echo "canmv_v2 board power reset done. continue to run test job";
elif [[ "$HW_MODEL" == "canmv" ]]
then
echo "---canmv board will skip power job after test done---";
# $power_reset;
# sleep 2;
# echo "canmv board power reset done. continue to run test job";
else
echo "---evb board will be power off after test done---";
$power_off;
# sleep 2;
# $power_on;
# sleep 2;
echo "evb board power off and power on done. continue in next loop";
fi
echo "---device power job done---";
- echo "----------release test device done----------"
load_image:
- echo "----------load image to test device----------"
- echo "sysimage-sdcard.img.gz md5 ${sysimage_md5}"
- test -d bin || mkdir ./bin
- test -f ./bin/aiload && rm -rf ./bin/aiload
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/tools/k230load -O ./bin/aiload
- chmod +x ./bin/aiload
- echo "MR ID ${CI_MERGE_REQUEST_IID}"
- echo "Pipeline ID ${CI_PIPELINE_ID}"
- |
echo "---start to load image in for loop";
stime=$(date +'%Y-%m-%d %H:%M:%S');
echo "---load image start time: $stime";
load_cmd="./bin/aiload --file_name=$NFS_CASE_FOLDER/${TEST_ENV}.yml";
echo "${load_cmd}";
for i in {1..6}; do
if [ $i -eq 6 ]
then
echo "ERROR: Max retries reached with load image";
exit 1;
fi
starttime=$(date +'%Y-%m-%d %H:%M:%S');
echo "---loop $i start time: $starttime";
echo "---start to load image in loop $i---";
if eval $load_cmd
then
echo "---loop $i load image pass---";
break;
else
echo "ERROR:loop $i load image failed, ignore Error and retry again...";
echo "---start to run device power job after failed job...";
if [[ "$HW_MODEL" == "canmv_v2" ]]
then
echo "---canmv_v2 board will be power reset at the end of loop $i ---";
$power_reset;
sleep 15;
echo "canmv_v2 board power reset done. continue in next loop";
elif [[ "$HW_MODEL" == "canmv" ]]
then
echo "---canmv board will be power reset at the end of loop $i ---";
$power_reset;
sleep 15;
echo "canmv board power reset done. continue in next loop";
else
echo "---evb board will be power off and power on at the end of loop $i---";
$power_off;
sleep 3;
$power_on;
sleep 15;
echo "evb board power off and power on done. continue in next loop";
fi
echo "---device power action, start to rerun in next loop...";
fi
endtime=$(date +'%Y-%m-%d %H:%M:%S');
start_seconds=$(date -d "$starttime" +%s);
end_seconds=$(date -d "$endtime" +%s);
echo "---loop $i end time: $endtime";
echo "---loop $i total cost time:$((end_seconds - start_seconds)) s";
done
etime=$(date +'%Y-%m-%d %H:%M:%S');
s_seconds=$(date -d "$stime" +%s);
e_seconds=$(date -d "$etime" +%s);
echo "---load image end time: $etime";
echo "---load image total cost time:$((e_seconds - s_seconds)) s";
echo "---finished load image in loop $i";
- echo "---load image pass"
- echo "----------load image to test device done----------"
copy_test_resource:
- echo "----------Step 5. copy test resource----------"
- echo "get build step result"
- *show_vars
- pwd
- echo "---get nfs case floder---"
- |
echo ${NFS_BASE}
echo "set NFS_DST_DIR with different type based on docs/images/src"
NFS_DST_DIR="${NFS_BASE}/${HW_TYPE}/${HW_MODEL}_${HW_VER}"
echo ${NFS_DST_DIR}
echo "---create NFS dir---"
echo "generate sub dir for MR/Pre-releae/relese job"
echo "check job from MR or tag or schedule or web"
if [[ ${CI_MERGE_REQUEST_IID} ]]; then
echo "current job is MR, skip and use CI_MERGE_REQUEST_IID"
elif [[ ${CI_COMMIT_TAG} ]]; then
echo "current job is release job, use CI_COMMIT_TAG"
CI_MERGE_REQUEST_IID=${CI_COMMIT_TAG}
elif [[ $CI_PIPELINE_SOURCE == "schedule" ]]; then
echo "current job is daily build schedule job, use CI_PIPELINE_SOURCE"
CI_MERGE_REQUEST_IID=$CI_PIPELINE_SOURCE
else
echo "current job is not match, use CI_PIPELINE_SOURCE"
CI_MERGE_REQUEST_IID=$CI_PIPELINE_SOURCE
fi
echo "current MR ID ${CI_MERGE_REQUEST_IID}"
SUB_DIR="${CI_MERGE_REQUEST_IID}_${CI_PIPELINE_ID}"
NFS_CASE_FOLDER="${NFS_DST_DIR}/${SUB_DIR}/${CONF}/${TEST_ENV}"
echo "NFS_CASE_FOLDER: $NFS_CASE_FOLDER"
echo "update current NFS_CASE_FOLDER permission before write"
sudo mkdir -p ${NFS_CASE_FOLDER} || exit 1
sudo chmod -R 777 ${NFS_CASE_FOLDER} || exit 1
- echo "---add testcase script to nfs folder"
- git clone ${TEST_SCRIPTS_REPO} k230_canmv_testscripts || exit 1
- cd k230_canmv_testscripts || exit 1
- timeout 1m git fetch origin main || { echo "timeout matched">&2; sleep 15; timeout 1m git fetch origin main || { echo "timeout2 matched,">&2; timeout 1m git fetch origin main; exit 1; } }
- git checkout main || exit 1
- echo "check micropython_testcases dir should be exist"
- ls micropython_testcases || exit 1
- cd ../ || exit 1
- echo "---copy test resource to nfs dir in nfs_server"
- time cp -rf --sparse=always ./k230_canmv_testscripts/micropython_testcases/ $NFS_CASE_FOLDER/
- cd $NFS_CASE_FOLDER/ || exit 1;
- ls -alht || exit 1
- |
if [[ -d "micropython_testcases" ]]; then
echo "micropython_testcases dir exist, continue run test job"
else
echo "micropython_testcases dir not exit, return error and exit"
exit 1
fi
- echo "confirm micropython_testcase dir again"
- ls -alht micropython_testcases || exit 1
- echo "show test resource in nfs_server"
- tree $NFS_CASE_FOLDER
- cd -
- pwd
- echo "finished copy test resource in nfs_server"
- echo "----------Step 7. generate test device yml file for test job----------"
- echo "run command ./bin/ailab convert --dest=script --format yaml --file_name=${TEST_ENV}.yml --nfs_server_ip $NFS_SERVER --nfs_case_folder $NFS_CASE_FOLDER --only_rtt ${ONLY_RTT} --conf ${CONF} --pr_id ${CI_MERGE_REQUEST_IID} --job_id ${CI_PIPELINE_ID} --sysimage_md5 ${sysimage_md5} ${available}"
- ./bin/ailab convert --dest=script --format yaml --file_name=${TEST_ENV}.yml --nfs_server_ip $NFS_SERVER --nfs_case_folder $NFS_CASE_FOLDER --only_rtt ${ONLY_RTT} --conf ${CONF} --pr_id ${CI_MERGE_REQUEST_IID} --job_id ${CI_PIPELINE_ID} --sysimage_md5 ${sysimage_md5} ${available}
- test -f ${TEST_ENV}.yml || exit 1
- cat ${TEST_ENV}.yml || exit 1
- echo "cp ${TEST_ENV}.yml to nfs_case_folder for NUC remote PC audio job"
- cp -rf --sparse=always ${TEST_ENV}.yml $NFS_CASE_FOLDER/ || exit 1
- test -f $NFS_CASE_FOLDER/${TEST_ENV}.yml || exit 1
- echo "show test resource in nfs_server"
- echo $NFS_CASE_FOLDER
- ls -alht $NFS_CASE_FOLDER
smoke_test:
- echo "----------Run Smoke Test start----------"
- echo "---add test script"
- test -d k230_canmv_testscripts || git clone ${TEST_SCRIPTS_REPO} k230_canmv_testscripts || exit 1
- cd k230_canmv_testscripts || exit 1
- timeout 1m git fetch origin main || { echo "timeout matched">&2; sleep 15; timeout 1m git fetch origin main || { echo "timeout2 matched,">&2; timeout 1m git fetch origin main; exit 1; } }
- git checkout main || exit 1
- pwd
- test -d bin || mkdir ./bin
- test -f ./bin/airobot && rm -rf ./bin/airobot
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/tools/airobot -O ./bin/airobot
- chmod +x ./bin/airobot
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/testscripts/k230_micropython_smoke_test.sh -O ./k230_micropython_smoke_test.sh
- chmod +x ./k230_micropython_smoke_test.sh
- ls -alht
- |
echo "---start to run k230 micropython smoke test in for loop"
stime=$(date +'%Y-%m-%d %H:%M:%S')
echo "---run k230 smoke test start time: $stime"
test_cmd="./k230_micropython_smoke_test.sh $NFS_CASE_FOLDER/${TEST_ENV}.yml"
for i in {1..2}; do
if [ $i -eq 2 ]
then
echo "ERROR: Max retries reached with run k230 micropython smoke test"
exit 1
fi
starttime=$(date +'%Y-%m-%d %H:%M:%S')
echo "---loop $i start time: $starttime"
echo "---start to run k230 canmicropythonmv smoke test in loop $i---"
if eval $test_cmd
then
echo "---loop $i run k230 micropython smoke test pass---"
break
else
echo "ERROR:loop $i run k230 micropython smoke test failed, ignore Error and try again..."
echo "---start to rerun in next loop..."
sleep 3
fi
endtime=$(date +'%Y-%m-%d %H:%M:%S')
start_seconds=$(date -d "$starttime" +%s)
end_seconds=$(date -d "$endtime" +%s)
echo "---loop $i end time: $endtime"
echo "---loop $i total cost time:$((end_seconds - start_seconds)) s"
done
etime=$(date +'%Y-%m-%d %H:%M:%S')
s_seconds=$(date -d "$stime" +%s)
e_seconds=$(date -d "$etime" +%s)
echo "---run k230 micropython smoke test end time: $etime"
echo "---run k230 micropython smoke test total cost time:$((e_seconds - s_seconds)) s"
echo "---finished run k230 micropython smoke test in loop $i"
- echo "----------Run Smoke Test pass----------"
daily_test:
- echo "----------Run Daily Test start----------"
- echo "---add test script"
- test -d k230_canmv_testscripts || git clone ${TEST_SCRIPTS_REPO} k230_canmv_testscripts || exit 1
- cd k230_canmv_testscripts || exit 1
- timeout 1m git fetch origin main || { echo "timeout matched">&2; sleep 15; timeout 1m git fetch origin main || { echo "timeout2 matched,">&2; timeout 1m git fetch origin main; exit 1; } }
- git checkout main || exit 1
- test -d bin || mkdir ./bin
- test -f ./bin/airobot && rm -rf ./bin/airobot
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/tools/airobot -O ./bin/airobot
- chmod +x ./bin/airobot
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/testscripts/k230_micropython_daily_test.sh -O ./k230_micropython_daily_test.sh
- chmod +x ./k230_micropython_daily_test.sh
- |
echo "---start to run k230 micropython daily test in for loop"
stime=$(date +'%Y-%m-%d %H:%M:%S')
echo "---run k230 micropython daily test start time: $stime"
test_cmd="./k230_micropython_daily_test.sh $NFS_CASE_FOLDER/${TEST_ENV}.yml"
for i in {1..2}; do
if [ $i -eq 2 ]
then
echo "ERROR: Max retries reached with run k230 micropython daily test"
exit 1
fi
starttime=$(date +'%Y-%m-%d %H:%M:%S')
echo "---loop $i start time: $starttime"
echo "---start to run k230 micropython daily test in loop $i---"
if eval $test_cmd
then
echo "---loop $i run k230 micropython daily test pass---"
break
else
echo "ERROR:loop $i run k230 micropython daily test failed, ignore Error and try again..."
echo "---start to rerun in next loop..."
sleep 3
fi
endtime=$(date +'%Y-%m-%d %H:%M:%S')
start_seconds=$(date -d "$starttime" +%s)
end_seconds=$(date -d "$endtime" +%s)
echo "---loop $i end time: $endtime"
echo "---loop $i total cost time:$((end_seconds - start_seconds)) s"
done
etime=$(date +'%Y-%m-%d %H:%M:%S')
s_seconds=$(date -d "$stime" +%s)
e_seconds=$(date -d "$etime" +%s)
echo "---run k230 micropython daily test end time: $etime"
echo "---run k230 micropython daily test total cost time:$((e_seconds - s_seconds)) s"
echo "---finished run k230 micropython daily test in loop $i"
- echo "----------Run Daily Test pass----------"
before_script:
- echo '----------Build ENV Prepare----------'
- echo 'Add SSH KEY for Multiple repo clone in Makefile'
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | ssh-add - > ~/.ssh/id_ed25519 || exit 1
- '[[ -f /.dockerenv ]] && echo -e "Host *\n StrictHostKeyChecking no\n" > ~/.ssh/config'
- echo $SHELL
- echo "config ssh timeout"
- echo " ServerAliveInterval 30" >> ~/.ssh/config
- echo " ServerAliveCountMax 60" >> ~/.ssh/config
- echo " TCPKeepAlive yes" >> ~/.ssh/config
- cat ~/.ssh/config
- whoami
- uptime
- pwd
- ls -alht
- ls -alht k230_sdk
- ls -alht micropython
- uname -a
- cat /etc/issue
- echo $CI_PROJECT_DIR
- echo $CI_PROJECT_NAME
- echo $CI_PIPELINE_SOURCE
- echo $CI_COMMIT_TAG
- echo '----------Set git config----------'
- echo "${GITLAB_USER_EMAIL}"
- echo "${GITLAB_USER_NAME}"
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- git config --global --add safe.directory $CI_PROJECT_DIR
- git config --global --add safe.directory $CI_PROJECT_DIR/k230_sdk
- git config --global --add safe.directory $CI_PROJECT_DIR/micropython
- echo '----------fetch all tags----------'
- timeout 1m git fetch --tags || { echo "timeout matched">&2; sleep 15; timeout 1m git fetch --tags || { echo "timeout2 matched,">&2; timeout 1m git fetch --tags; exit 1; } }
- HW_TYPE=$(echo $CONF | awk -F '_' '{print $1}')
- HW_MODEL=$(echo $CONF | awk -F "_" '{if ($3 == "v2") print $2"_"$3; else print $2}')
- echo "HW_TYPE ${HW_TYPE}, HW_MODEL ${HW_MODEL}"
- |
if [[ $CONF =~ "only_rtt_defconfig" ]]; then
ONLY_RTT=True
else
ONLY_RTT=False
fi
- echo "ONLY_RTT is ${ONLY_RTT}"
after_script:
- *show_vars
- *get_job_result
# build setup for all jobs
build_setup:
stage: build_setup
rules:
# MR job to dev branch
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "dev"
# release job
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
# pre-release job
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
# manual job
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_TAG !~ /^v\d+\.\d+.*$/
# daily build
- if: $CI_PIPELINE_SOURCE == "schedule"
timeout: 5m
script:
- echo "build env setup"
- *get_job_type
- *latest_version
- *generate_version
- echo "JOB_TYPE=${JOB_TYPE}" >> build.env
- echo "DST_BASE=${DST_BASE}" >> build.env
- echo "SUB_BASE=${new_ver}" >> build.env
artifacts:
reports:
dotenv: build.env
# first build with src for MR
build_image:
stage: build_src
rules:
# MR job to dev branch
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "dev"
# release job
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
# pre-release job
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
# manual job
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_TAG !~ /^v\d+\.\d+.*$/
# daily build
- if: $CI_PIPELINE_SOURCE == "schedule"
timeout: 45m
parallel:
matrix:
- CONF:
- k230_canmv_defconfig
- k230d_canmv_only_rtt_defconfig
- k230_canmv_01studio_defconfig
variables:
SRC_DIR: ./output/${CONF}/images
script:
- *show_vars
- *check_build_result
- !reference [.common, build_image]
- !reference [.common, save_tftp]
- !reference [.common, save_image]
- cat $CI_PROJECT_DIR/build.env
artifacts:
reports:
dotenv: build.env
#test setup for all jobs
load_image_smoke_test:
stage: smoke_test
variables:
TEST_ENV: ai
CONF: k230_canmv_defconfig
rules:
# MR job to dev branch
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "dev"
# release job
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
# pre-release job
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
# manual job
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_TAG !~ /^v\d+\.\d+.*$/
# daily build
- if: $CI_PIPELINE_SOURCE == "schedule"
timeout: 60m
script:
- *show_vars
- *check_build_result
- !reference [.test, test_setup]
- !reference [.test, copy_test_resource]
- !reference [.test, load_image]
- !reference [.test, smoke_test]
after_script:
- !reference [.test, test_teardown]
- *show_vars
- *get_job_result
# daily build test
daily_build_test: