Skip to content

[CI] Add url option #1116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions CI/build/arduino-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ def check_config():
global root_output_dir
global output_dir
global log_file
global stm32_url

if args.ci is False:
if os.path.isfile(path_config_filename):
try:
Expand Down Expand Up @@ -198,11 +200,11 @@ def check_config():

try:
output = subprocess.check_output(
[arduino_cli, "version"], stderr=subprocess.DEVNULL,
[arduino_cli, "version"], stderr=subprocess.STDOUT,
)
except subprocess.CalledProcessError as e:
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
print(e.stdout)
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
res = re.match(r".*Version:\s+(\d+\.\d+\.\d+).*", output.decode("utf-8"))
Expand All @@ -215,14 +217,17 @@ def check_config():
+ arduino_cli_default_version
)

if args.url:
stm32_url = args.url

try:
output = subprocess.check_output(
[arduino_cli, "core", "search", "stm32", "--additional-urls", stm32_url],
stderr=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
)
except subprocess.CalledProcessError as e:
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
print(e.stdout)
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
if arduino_platform not in output.decode("utf-8"):
Expand All @@ -232,13 +237,13 @@ def check_config():
try:
output = subprocess.check_output(
[arduino_cli, "config", "dump", "--format", "json"],
stderr=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
).decode("utf-8")
except subprocess.CalledProcessError as e:
print(
'"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode)
)
print(e.stdout)
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
cli_config = json.loads(output)
Expand Down Expand Up @@ -465,7 +470,7 @@ def find_board():
).decode("utf-8")
except subprocess.CalledProcessError as e:
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
print(e.stdout)
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
boards_list = json.loads(output)
Expand All @@ -488,7 +493,7 @@ def find_board():
print(
'"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode)
)
print(e.stdout)
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
board_detail = json.loads(output)
Expand Down Expand Up @@ -874,6 +879,12 @@ def build(build_conf):
+ cores_config_file_default,
)

parser.add_argument(
"-u", "--url", metavar="<string>", help="additional URL for the board manager\
Default url : "
+ stm32_url,
)

parser.add_argument(
"-v", "--verbose", help="enable arduino-cli verbose mode", action="store_true"
)
Expand Down