forked from kendryte/k510_BBL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
116 lines (111 loc) · 3.41 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
default:
image: k510_sdk:latest
stages:
- env
- build_bbl
- clean
env:
stage: env
tags:
- docker
only:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
before_script:
- echo '----------Build ENV Prepare----------'
- echo 'Add SSH KEY for Kernel clone'
- '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
- ls -alht ~/.ssh
- pwd
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- echo $SHELL
script:
- echo '----------Build ENV Check----------'
- whoami
- uptime
- pwd
- uname -a
- cat /etc/issue
- echo $SHELL
after_script:
- echo '----------Clean ENV for build----------'
- echo $SHELL
build_bbl:
stage: build_bbl
needs: ["env"]
tags:
- docker
only:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
before_script:
- echo '----------Build ENV Check----------'
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ls -alht ~/.ssh
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | ssh-add - > ~/.ssh/id_ed25519
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- uptime
- uname -a
- cat /etc/issue
- pwd
- ls -alht
- echo $SHELL
- echo $SHELL
- echo '----------Switch to git repo parent directory and prepare Linux kernel----------'
- cd /builds/maix/
- ls -alht
- echo '----------Clone Linux Kernel git repo----------'
- rm -rf /builds/maix/k510_linux_kernel/
- git clone git@g.b-bug.org:maix/k510_linux_kernel.git
- echo '----------Switch to Linux Kernel directory----------'
- cd k510_linux_kernel
- echo '----------Prepare Linux Kernel for BBL build----------'
- source /home/ubuntu/AndeSight_STD_v323/linux_v323.sh
- echo '----------Build Linux Kernel Start----------'
- make k510_defconfig
- make vmlinux
- echo '----------Build Linux Kernel Finished----------'
script:
- echo '----------Switch to BBl git repo and Create BBL build directory----------'
- cd /builds/maix/k510_bbl/
- mkdir -p build
- cd build
- echo '----------Build BBL ENV Prepare----------'
- source /home/ubuntu/AndeSight_STD_v323/linux_v323.sh
- echo '----------Config BBL build env with Linux Kernel----------'
- ls -alht /builds/maix/k510_linux_kernel/ |grep vmlinux
- /builds/maix/k510_bbl/configure --host=riscv64-linux --with-payload=/builds/maix/k510_linux_kernel/vmlinux
- echo '----------Build BBL Start in current directory----------'
- make
- echo '----------Convert ELF format bbl to Binary format----------'
- riscv64-linux-objcopy -O binary bbl bbl.bin
- pwd
- ls -alht |grep bbl
clean:
stage: clean
needs: ["build_bbl"]
tags:
- docker
only:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
script:
- pwd
- uptime
- ls -alht