Skip to content

Commit 2d498c7

Browse files
authored
Merge pull request stm32duino#1116 from fpistm/CI_dev
[CI] Add url option
2 parents cfc2de7 + 422fde9 commit 2d498c7

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

CI/build/arduino-cli.py

+19-8
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def check_config():
161161
global root_output_dir
162162
global output_dir
163163
global log_file
164+
global stm32_url
165+
164166
if args.ci is False:
165167
if os.path.isfile(path_config_filename):
166168
try:
@@ -198,11 +200,11 @@ def check_config():
198200

199201
try:
200202
output = subprocess.check_output(
201-
[arduino_cli, "version"], stderr=subprocess.DEVNULL,
203+
[arduino_cli, "version"], stderr=subprocess.STDOUT,
202204
)
203205
except subprocess.CalledProcessError as e:
204206
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
205-
print(e.stdout)
207+
print(e.stdout.decode("utf-8"))
206208
quit(e.returncode)
207209
else:
208210
res = re.match(r".*Version:\s+(\d+\.\d+\.\d+).*", output.decode("utf-8"))
@@ -215,14 +217,17 @@ def check_config():
215217
+ arduino_cli_default_version
216218
)
217219

220+
if args.url:
221+
stm32_url = args.url
222+
218223
try:
219224
output = subprocess.check_output(
220225
[arduino_cli, "core", "search", "stm32", "--additional-urls", stm32_url],
221-
stderr=subprocess.DEVNULL,
226+
stderr=subprocess.STDOUT,
222227
)
223228
except subprocess.CalledProcessError as e:
224229
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
225-
print(e.stdout)
230+
print(e.stdout.decode("utf-8"))
226231
quit(e.returncode)
227232
else:
228233
if arduino_platform not in output.decode("utf-8"):
@@ -232,13 +237,13 @@ def check_config():
232237
try:
233238
output = subprocess.check_output(
234239
[arduino_cli, "config", "dump", "--format", "json"],
235-
stderr=subprocess.DEVNULL,
240+
stderr=subprocess.STDOUT,
236241
).decode("utf-8")
237242
except subprocess.CalledProcessError as e:
238243
print(
239244
'"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode)
240245
)
241-
print(e.stdout)
246+
print(e.stdout.decode("utf-8"))
242247
quit(e.returncode)
243248
else:
244249
cli_config = json.loads(output)
@@ -465,7 +470,7 @@ def find_board():
465470
).decode("utf-8")
466471
except subprocess.CalledProcessError as e:
467472
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
468-
print(e.stdout)
473+
print(e.stdout.decode("utf-8"))
469474
quit(e.returncode)
470475
else:
471476
boards_list = json.loads(output)
@@ -488,7 +493,7 @@ def find_board():
488493
print(
489494
'"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode)
490495
)
491-
print(e.stdout)
496+
print(e.stdout.decode("utf-8"))
492497
quit(e.returncode)
493498
else:
494499
board_detail = json.loads(output)
@@ -874,6 +879,12 @@ def build(build_conf):
874879
+ cores_config_file_default,
875880
)
876881

882+
parser.add_argument(
883+
"-u", "--url", metavar="<string>", help="additional URL for the board manager\
884+
Default url : "
885+
+ stm32_url,
886+
)
887+
877888
parser.add_argument(
878889
"-v", "--verbose", help="enable arduino-cli verbose mode", action="store_true"
879890
)

0 commit comments

Comments
 (0)