@@ -168,8 +168,14 @@ def source_repos(config, examples):
168
168
if os .path .exists (name ):
169
169
print ("'%s' example directory already exists. Deleting..." % name )
170
170
rmtree (name )
171
+
172
+ cmd = "mbed-cli import %s" % repo_info ['repo' ]
173
+ result = subprocess .call (cmd , shell = True )
171
174
172
- subprocess .call (["mbed-cli" , "import" , repo_info ['repo' ]])
175
+ if result :
176
+ return result
177
+
178
+ return 0
173
179
174
180
def clone_repos (config , examples , retry = 3 ):
175
181
""" Clones each of the repos associated with the specific examples name from the
@@ -187,11 +193,14 @@ def clone_repos(config, examples , retry = 3):
187
193
if os .path .exists (name ):
188
194
print ("'%s' example directory already exists. Deleting..." % name )
189
195
rmtree (name )
196
+ cmd = "%s clone %s" % (repo_info ['type' ], repo_info ['repo' ])
190
197
for i in range (0 , retry ):
191
- if subprocess .call ([ repo_info [ 'type' ], "clone" , repo_info [ 'repo' ]]) == 0 :
198
+ if not subprocess .call (cmd , shell = True ):
192
199
break
193
200
else :
194
201
print ("ERROR : unable to clone the repo {}" .format (name ))
202
+ return 1
203
+ return 0
195
204
196
205
def deploy_repos (config , examples ):
197
206
""" If the example directory exists as provided by the json config file,
@@ -207,11 +216,15 @@ def deploy_repos(config, examples):
207
216
if name in examples :
208
217
if os .path .exists (name ):
209
218
os .chdir (name )
210
- subprocess .call ([ "mbed-cli" , " deploy"] )
219
+ result = subprocess .call ("mbed-cli deploy" , shell = True )
211
220
os .chdir (".." )
221
+ if result :
222
+ print ("mbed-cli deploy command failed for '%s'" % name )
223
+ return result
212
224
else :
213
225
print ("'%s' example directory doesn't exist. Skipping..." % name )
214
-
226
+ return 1
227
+ return 0
215
228
216
229
def get_num_failures (results , export = False ):
217
230
""" Returns the number of failed compilations from the results summary
@@ -405,5 +418,11 @@ def update_mbedos_version(config, tag, examples):
405
418
update_dir = basename (repo_info ['repo' ]) + "/mbed-os"
406
419
print ("\n Changing dir to %s\n " % update_dir )
407
420
os .chdir (update_dir )
408
- subprocess .call (["mbed-cli" , "update" , tag , "--clean" ])
421
+ cmd = "mbed-cli update %s --clean" % tag
422
+ result = subprocess .call (cmd , shell = True )
409
423
os .chdir ("../.." )
424
+ if result :
425
+ return result
426
+
427
+ return 0
428
+
0 commit comments