-
Notifications
You must be signed in to change notification settings - Fork 49
/
.gitlab-ci.yml
282 lines (238 loc) · 7.87 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
stages:
- build
- deploy
# global variables
variables: &global-variables
GIT_STRATEGY: clone
PYTHON_VER: 3
.setup_esp_idf: &setup_esp_idf
- image_str=${image}
- image_str=(${image_str//:/ })
- idf_branch=${image_str[1]}
- cd $IDF_PATH
- git checkout ${idf_branch}
- git submodule update --init --recursive
- ./install.sh
- . ./export.sh
- cd -
.before_script_preparation: &before_script_preparation
- 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
- export IDF_PATH=/opt/esp/idf
# - python -m pip install --upgrade idf-component-manager
- pip install idf-component-manager==1.4.1
.build_iot_bridge_default: &build_iot_bridge_default
- cd examples/wireless_nic
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_ETHERNET=y\nCONFIG_BRIDGE_DATA_FORWARDING_NETIF_SPI=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
- git checkout -- .
- git clean -xdff
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_SPI=y" >> sdkconfig.defaults.${idf_target}
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_MODEM=y" >> sdkconfig.defaults.${idf_target}
- echo -e "\nCONFIG_APP_BRIDGE_USE_WIFI_PROVISIONING_OVER_BLE=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
.build_iot_bridge_esp32: &build_iot_bridge_esp32
- cd examples/wireless_nic
- echo -e "\nCONFIG_BRIDGE_DATA_FORWARDING_NETIF_SDIO=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
- git checkout -- .
- git clean -xdff
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_SDIO=y" >> sdkconfig.defaults.${idf_target}
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_ETHERNET=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
.build_iot_bridge_esp32s2: &build_iot_bridge_esp32s2
- cd examples/wireless_nic
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_ETHERNET=y\nCONFIG_BRIDGE_DATA_FORWARDING_NETIF_SPI=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
- git checkout -- .
- git clean -xdff
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_SPI=y" >> sdkconfig.defaults.${idf_target}
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_MODEM=y" >> sdkconfig.defaults.${idf_target}
- echo -e "\nCONFIG_BRIDGE_DATA_FORWARDING_NETIF_USB=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
.build_iot_bridge_esp32s3: &build_iot_bridge_esp32s3
- cd examples/wireless_nic
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_ETHERNET=y\nCONFIG_BRIDGE_DATA_FORWARDING_NETIF_SPI=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
- git checkout -- .
- git clean -xdff
- echo -e "\nCONFIG_APP_BRIDGE_USE_WIFI_PROVISIONING_OVER_BLE=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
- git checkout -- .
- git clean -xdff
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_SPI=y" >> sdkconfig.defaults.${idf_target}
- echo -e "\nCONFIG_BRIDGE_EXTERNAL_NETIF_MODEM=y" >> sdkconfig.defaults.${idf_target}
- echo -e "\nCONFIG_BRIDGE_DATA_FORWARDING_NETIF_USB=y" >> sdkconfig.defaults.${idf_target}
- idf.py set-target ${idf_target}
- idf.py build
.build_wifi_router_examples: &build_wifi_router_examples
- cd examples/wifi_router
- rm -rf build sdkconfig
- idf.py set-target ${idf_target}
- idf.py build
- cd -
.build_wireless_nic_examples: &build_wireless_nic_examples
- cd examples/wireless_nic
- rm -rf build sdkconfig
- idf.py set-target ${idf_target}
- idf.py build
- cd -
.build_wired_nic_examples: &build_wired_nic_examples
- cd examples/wired_nic
- rm -rf build sdkconfig
- idf.py set-target ${idf_target}
- idf.py build
- cd -
.build_4g_hotspot_examples: &build_4g_hotspot_examples
- cd examples/4g_hotspot
- rm -rf build sdkconfig
- idf.py set-target ${idf_target}
- idf.py build
- cd -
.build_4g_nic_examples: &build_4g_nic_examples
- cd examples/4g_nic
- rm -rf build sdkconfig
- idf.py set-target ${idf_target}
- idf.py build
- cd -
.build_iot_bridge_examples: &build_iot_bridge_examples
- *build_wifi_router_examples
- *build_wireless_nic_examples
- *build_wired_nic_examples
- *build_4g_hotspot_examples
- *build_4g_nic_examples
esp32_build:
stage: build
tags:
- build
image: $IMAGE
parallel:
matrix:
- IMAGE: ['espressif/idf:release-v5.0', 'espressif/idf:release-v5.1', 'espressif/idf:release-v5.2', 'espressif/idf:release-v5.3']
variables:
<<: *global-variables
idf_target: esp32
before_script:
- *before_script_preparation
script:
- *setup_esp_idf
- *build_iot_bridge_examples
- *build_iot_bridge_esp32
esp32c2_build:
stage: build
tags:
- build
image: $IMAGE
parallel:
matrix:
- IMAGE: ['espressif/idf:release-v5.0', 'espressif/idf:release-v5.1', 'espressif/idf:release-v5.2', 'espressif/idf:release-v5.3']
variables:
<<: *global-variables
idf_target: esp32c2
before_script:
- *before_script_preparation
script:
- *setup_esp_idf
- *build_iot_bridge_examples
- *build_iot_bridge_default
esp32c3_build:
stage: build
tags:
- build
image: $IMAGE
parallel:
matrix:
- IMAGE: ['espressif/idf:release-v5.0', 'espressif/idf:release-v5.1', 'espressif/idf:release-v5.2', 'espressif/idf:release-v5.3']
variables:
<<: *global-variables
idf_target: esp32c3
before_script:
- *before_script_preparation
script:
- *setup_esp_idf
- *build_iot_bridge_examples
- *build_iot_bridge_default
esp32s2_build:
stage: build
tags:
- build
image: $IMAGE
parallel:
matrix:
- IMAGE: ['espressif/idf:release-v5.0', 'espressif/idf:release-v5.1', 'espressif/idf:release-v5.2', 'espressif/idf:release-v5.3']
variables:
<<: *global-variables
idf_target: esp32s2
before_script:
- *before_script_preparation
script:
- *setup_esp_idf
- *build_iot_bridge_examples
- *build_iot_bridge_esp32s2
esp32s3_build:
stage: build
tags:
- build
image: $IMAGE
parallel:
matrix:
- IMAGE: ['espressif/idf:release-v5.0', 'espressif/idf:release-v5.1', 'espressif/idf:release-v5.2', 'espressif/idf:release-v5.3']
variables:
<<: *global-variables
idf_target: esp32s3
before_script:
- *before_script_preparation
script:
- *setup_esp_idf
- *build_iot_bridge_examples
- *build_iot_bridge_esp32s3
esp32c6_build:
stage: build
tags:
- build
image: $IMAGE
parallel:
matrix:
- IMAGE: ['espressif/idf:release-v5.1', 'espressif/idf:release-v5.2', 'espressif/idf:release-v5.3']
variables:
<<: *global-variables
idf_target: esp32c6
before_script:
- *before_script_preparation
script:
- *setup_esp_idf
- *build_iot_bridge_examples
- *build_iot_bridge_default
push_master_to_github:
stage: deploy
only:
- master
# when: on_success
image: $CI_DOCKER_REGISTRY/esp32-ci-env
variables:
GIT_STRATEGY: clone
GITHUB_PUSH_REFS: refs/remotes/origin/release refs/remotes/origin/master
before_script:
- echo "skip default before_script"
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
- if [ -d "components/iot_bridge/priv_src" ]; then exit 1; fi
- git remote add github git@github.com:espressif/esp-iot-bridge.git
- 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)