-
Notifications
You must be signed in to change notification settings - Fork 536
/
.gitlab-ci.yml
executable file
·286 lines (262 loc) · 7.34 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
stages:
- build
- deploy
.install_compiler: &install_compiler
- wget https://dl.espressif.com/dl/xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
- tar -zxvf xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
- export PATH=./xtensa-lx106-elf/bin/:$PATH
- xtensa-lx106-elf-gcc -v
.build_template: &build_template
stage: build
image: $CI_DOCKER_REGISTRY/esp8266-ci-env
tags:
- build
variables:
GIT_STRATEGY: clone
SSC_DEFAULT_BRANCH: release/esp8266_nonos_sdk
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GITLAB_KEY >> ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- *install_compiler
# build_ssc:
# <<: *build_template
# artifacts:
# paths:
# - ./SSC/ssc_bin
# expire_in: 6 mos
# script:
# - git clone $GITLAB_SSH_SERVER/yinling/SSC.git
# - cd SSC
# # ssc master branch does not support nonos any more, now checkout to the reserved branch
# - git checkout ${SSC_DEFAULT_BRANCH}
# - chmod +x gen_misc_non_os.sh
# - ./gen_misc_non_os.sh
.at_setup_tokens: &at_setup_tokens
- echo -e "#define CONFIG_AT_1024_1024_TOKEN \"$AT_1024_1024_TOKEN\"" >> include/user_config.h
- echo -e "#define CONFIG_AT_512_512_TOKEN \"$AT_512_512_TOKEN\"" >> include/user_config.h
build_at_1024_1024_u1:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at at
- cd at
- *at_setup_tokens
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5 AT_ESP_UPGRADE=1
build_at_1024_1024_u2:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at at
- cd at
- *at_setup_tokens
- make COMPILE=gcc BOOT=new APP=2 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5 AT_ESP_UPGRADE=1
build_at_512_512_u1:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at_nano at
- cd at
- *at_setup_tokens
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=2 AT_ESP_UPGRADE=1
build_at_512_512_u2:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at_nano at
- cd at
- *at_setup_tokens
- make COMPILE=gcc BOOT=new APP=2 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=2 AT_ESP_UPGRADE=1
build_at_espconn:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at_espconn at_espconn
- cd at_espconn
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_at_nano:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at_nano at_nano
- cd at_nano
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_at_sdio:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/at_sdio at_sdio
- cd at_sdio
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_esp_mqtt_proj:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/esp_mqtt_proj esp_mqtt_proj
- cd esp_mqtt_proj
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
# build_IoT_Demo:
# <<: *build_template
# artifacts:
# paths:
# - ./bin/upgrade
# - ./bin/*.bin
# expire_in: 6 mos
# script:
# - cp -rf examples/IoT_Demo IoT_Demo
# - cd IoT_Demo
# - make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_peripheral_test:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/peripheral_test peripheral_test
- cd peripheral_test
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_simple_pair:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/simple_pair simple_pair
- cd simple_pair
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_smart_config:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/smart_config smart_config
- cd smart_config
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_wpa2_enterprise:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/wpa2_enterprise wpa2_enterprise
- cd wpa2_enterprise
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_wps:
<<: *build_template
artifacts:
paths:
- ./bin/upgrade
- ./bin/*.bin
expire_in: 6 mos
script:
- cp -rf examples/wps wps
- cd wps
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
build_gen_patch_bin:
<<: *build_template
artifacts:
paths:
- ./bin/*.h
expire_in: 6 mos
script:
- cp -rf examples/gen_patch_bin gen_patch_bin
- cd gen_patch_bin
- python2 gen_patch_bin.py
- cp patch_array.h ../bin/
build_driver_lib:
<<: *build_template
artifacts:
paths:
- ./lib
expire_in: 6 mos
script:
- cd driver_lib
- ./make_lib.sh driver
collect_at_bins:
stage: deploy
tags:
- deploy
needs:
- build_at_1024_1024_u1
- build_at_1024_1024_u2
- build_at_512_512_u1
- build_at_512_512_u2
image: $CI_DOCKER_REGISTRY/esp8266-ci-env
script:
- echo "Collecting AT bin files..."
- mkdir -p at/1024+1024
- mkdir -p at/512+512
- cp -f bin/upgrade/user1.2048.new.5.bin at/1024+1024/user1.2048.new.5.bin
- cp -f bin/upgrade/user2.2048.new.5.bin at/1024+1024/user2.2048.new.5.bin
- cp -f bin/upgrade/user1.1024.new.2.bin at/512+512/user1.1024.new.2.bin
- cp -f bin/upgrade/user2.1024.new.2.bin at/512+512/user2.1024.new.2.bin
artifacts:
paths:
- ./at
expire_in: 6 mos
push_master_to_github:
stage: deploy
only:
- master
- /^release\/v.*$/
tags:
- deploy
when: on_success
image: $CI_DOCKER_REGISTRY/esp8266-ci-env
variables:
GIT_STRATEGY: clone
GITHUB_PUSH_REFS: refs/remotes/origin/release refs/remotes/origin/master
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git remote add github [email protected]:espressif/ESP8266_NONOS_SDK.git
# - git push --follow-tags github HEAD:master
- eval $(git for-each-ref --shell bash --format 'if [ $CI_COMMIT_SHA == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS)