-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
203 lines (198 loc) · 7.67 KB
/
.gitlab-ci.yml
File metadata and controls
203 lines (198 loc) · 7.67 KB
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
variables:
#NAS地址
NAS_URL1: /mnt/百度云对外发布资料/Linux产品线/鲁班猫_瑞芯微系列/8-SDK源码压缩包及虚拟机/LubanCat_Linux_SDK
# NAS_URL1: /mnt/百度云内部资料/测试/LubanCat_SDK
stages: # 分段
- pack
pack-generic:
tags:
- ENABLE
stage: pack
when: manual
before_script:
- git config --global user.email "embedfire@embedfire.com"
- git config --global user.name "LubanCat"
script:
# 配置文件名称
- XML_FILE="lubancat_linux_generic.xml"
# 创建工作目录
- mkdir LubanCat_SDK && cd LubanCat_SDK && LubanCat_SDK_DIR=$(pwd)
# 拉取manifests仓库
- repo init --repo-url https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -u https://github.com/LubanCat/manifests.git -b linux -m ${XML_FILE}
# 获取真正的xml文件路径及目录
- XML_FILE_PATH=$(realpath .repo/manifests/${XML_FILE})
- XML_FILE_DIR=$(dirname ${XML_FILE_PATH})
# 获取xml文件的提交时间
- cd $XML_FILE_DIR && COMMIT_DATE=$(git log -1 --format="%ci" $XML_FILE_PATH | awk '{print $1}' | sed 's/-//g')
# 设置压缩包名称
- FILE_NAME="LubanCat_Linux_Generic_SDK"
- TAR_NAME="${FILE_NAME}_${COMMIT_DATE}.tgz" && echo TAR_NAME=$TAR_NAME
# 返回主目录
- cd $LubanCat_SDK_DIR
# 查看 .repo/repo/repo 版本
- .repo/repo/repo --version
# 替换为内部gitlab地址
- sed -i '/github/ s/^/ <!--/; /github/ s/$/ -->/' .repo/manifests/remote.xml
- sed -i '/gitlab/ s/<!--*//;/gitlab/ s/ *-->//' .repo/manifests/remote.xml
- cat .repo/manifests/remote.xml
# 拉取仓库
- .repo/repo/repo sync -c -v
# 替换回github地址
- cd .repo/manifests/ && git restore . && cd $LubanCat_SDK_DIR
- cat .repo/manifests/remote.xml
# 重新拉取,替换仓库地址为github
- .repo/repo/repo sync -c -v
# 打包:pigz打包更快
- tar -cvf - .repo/ | pigz > $TAR_NAME
# 显示本地文件列表
- ls -hl
# 删除原来的源码包
- rm -rf $NAS_URL1/${FILE_NAME}*.tgz
# 发布
- cp -v $TAR_NAME $NAS_URL1
# 清理
- cd .. && rm -rf LubanCat_SDK
pack-gen_full:
tags:
- ENABLE
stage: pack
when: manual
before_script:
- git config --global user.email "embedfire@embedfire.com"
- git config --global user.name "LubanCat"
script:
# 配置文件名称
- XML_FILE="lubancat_linux_gen_full.xml"
# 创建工作目录
- mkdir LubanCat_SDK && cd LubanCat_SDK && LubanCat_SDK_DIR=$(pwd)
# 拉取manifests仓库
- repo init --repo-url https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -u https://github.com/LubanCat/manifests.git -b linux -m ${XML_FILE}
# 获取真正的xml文件路径及目录
- XML_FILE_PATH=$(realpath .repo/manifests/${XML_FILE})
- XML_FILE_DIR=$(dirname ${XML_FILE_PATH})
# 获取xml文件的提交时间
- cd $XML_FILE_DIR && COMMIT_DATE=$(git log -1 --format="%ci" $XML_FILE_PATH | awk '{print $1}' | sed 's/-//g')
# 设置压缩包名称
- FILE_NAME="LubanCat_Linux_Generic_Full_SDK"
- TAR_NAME="${FILE_NAME}_${COMMIT_DATE}.tgz" && echo TAR_NAME=$TAR_NAME
# 返回主目录
- cd $LubanCat_SDK_DIR
# 查看 .repo/repo/repo 版本
- .repo/repo/repo --version
# 替换为内部gitlab地址
- sed -i '/github/ s/^/ <!--/; /github/ s/$/ -->/' .repo/manifests/remote.xml
- sed -i '/gitlab/ s/<!--*//;/gitlab/ s/ *-->//' .repo/manifests/remote.xml
- cat .repo/manifests/remote.xml
# 拉取仓库
- .repo/repo/repo sync -c -v
# 替换回github地址
- cd .repo/manifests/ && git restore . && cd $LubanCat_SDK_DIR
- cat .repo/manifests/remote.xml
# 重新拉取,替换仓库地址为github
- .repo/repo/repo sync -c -v
# 打包:pigz打包更快
- tar -cvf - .repo/ | pigz > $TAR_NAME
# 显示本地文件列表
- ls -hl
# 删除原来的源码包
- rm -rf $NAS_URL1/${FILE_NAME}*.tgz
# 发布
- cp -v $TAR_NAME $NAS_URL1
# 清理
- cd .. && rm -rf LubanCat_SDK
pack-rk3588:
tags:
- ENABLE
stage: pack
when: manual
before_script:
- git config --global user.email "embedfire@embedfire.com"
- git config --global user.name "LubanCat"
script:
# 配置文件名称
- XML_FILE="rk3588_linux_release.xml"
# 创建工作目录
- mkdir LubanCat_SDK && cd LubanCat_SDK && LubanCat_SDK_DIR=$(pwd)
# 拉取manifests仓库
- repo init --repo-url https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -u https://github.com/LubanCat/manifests.git -b linux -m ${XML_FILE}
# 获取真正的xml文件路径及目录
- XML_FILE_PATH=$(realpath .repo/manifests/${XML_FILE})
- XML_FILE_DIR=$(dirname ${XML_FILE_PATH})
# 获取xml文件的提交时间
- cd $XML_FILE_DIR && COMMIT_DATE=$(git log -1 --format="%ci" $XML_FILE_PATH | awk '{print $1}' | sed 's/-//g')
# 设置压缩包名称
- FILE_NAME="LubanCat_Linux_rk3588_SDK"
- TAR_NAME="${FILE_NAME}_${COMMIT_DATE}.tgz" && echo TAR_NAME=$TAR_NAME
# 返回主目录
- cd $LubanCat_SDK_DIR
# 查看 .repo/repo/repo 版本
- .repo/repo/repo --version
# 替换为内部gitlab地址
- sed -i '/github/ s/^/ <!--/; /github/ s/$/ -->/' .repo/manifests/${XML_FILE}
- sed -i '/gitlab/ s/<!--*//;/gitlab/ s/ *-->//' .repo/manifests/${XML_FILE}
- cat .repo/manifests/${XML_FILE}
# 拉取仓库
- .repo/repo/repo sync -c -v
# 替换回github地址
- cd .repo/manifests/ && git restore . && cd $LubanCat_SDK_DIR
- cat .repo/manifests/${XML_FILE}
# 重新拉取,替换仓库地址为github
- .repo/repo/repo sync -c -v
# 打包:pigz打包更快
- tar -cvf - .repo/ | pigz > $TAR_NAME
# 显示本地文件列表
- ls -hl
# 删除原来的源码包
- rm -rf $NAS_URL1/${FILE_NAME}*.tgz
# 发布
- cp -v $TAR_NAME $NAS_URL1
# 清理
- cd .. && rm -rf LubanCat_SDK
pack-rk356x:
tags:
- ENABLE
stage: pack
when: manual
before_script:
- git config --global user.email "embedfire@embedfire.com"
- git config --global user.name "LubanCat"
script:
# 配置文件名称
- XML_FILE="rk356x_linux_release.xml"
# 创建工作目录
- mkdir LubanCat_SDK && cd LubanCat_SDK && LubanCat_SDK_DIR=$(pwd)
# 拉取manifests仓库
- repo init --repo-url https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -u https://github.com/LubanCat/manifests.git -b linux -m ${XML_FILE}
# 获取真正的xml文件路径及目录
- XML_FILE_PATH=$(realpath .repo/manifests/${XML_FILE})
- XML_FILE_DIR=$(dirname ${XML_FILE_PATH})
# 获取xml文件的提交时间
- cd $XML_FILE_DIR && COMMIT_DATE=$(git log -1 --format="%ci" $XML_FILE_PATH | awk '{print $1}' | sed 's/-//g')
# 设置压缩包名称
- FILE_NAME="LubanCat_Linux_rk356x_SDK"
- TAR_NAME="${FILE_NAME}_${COMMIT_DATE}.tgz" && echo TAR_NAME=$TAR_NAME
# 返回主目录
- cd $LubanCat_SDK_DIR
# 查看 .repo/repo/repo 版本
- .repo/repo/repo --version
# 替换为内部gitlab地址
- sed -i '/github/ s/^/ <!--/; /github/ s/$/ -->/' .repo/manifests/${XML_FILE}
- sed -i '/gitlab/ s/<!--*//;/gitlab/ s/ *-->//' .repo/manifests/${XML_FILE}
- cat .repo/manifests/${XML_FILE}
# 拉取仓库
- .repo/repo/repo sync -c -v
# 替换回github地址
- cd .repo/manifests/ && git restore . && cd $LubanCat_SDK_DIR
- cat .repo/manifests/${XML_FILE}
# 重新拉取,替换仓库地址为github
- .repo/repo/repo sync -c -v
# 打包:pigz打包更快
- tar -cvf - .repo/ | pigz > $TAR_NAME
# 显示本地文件列表
- ls -hl
# 删除原来的源码包
- rm -rf $NAS_URL1/${FILE_NAME}*.tgz
# 发布
- cp -v $TAR_NAME $NAS_URL1
# 清理
- cd .. && rm -rf LubanCat_SDK