Skip to content
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

[Spring] Show help link in CLI console when build failed #5579

Merged
merged 10 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/spring/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
Release History
===============
1.4.0
---
* Show help link when `az spring app deploy` failed.

1.3.0
---
* Add new command group `az spring application-live-view` to manage Application Live View.
* Support route to app level in command `az spring gateway route-config create` and `az spring gateway route-config create`.
* Add new command group `az spring dev-tool` to manage Dev Tools.
* Add argument `--enable-application-live-view` in command `az spring create` to support enable application live view when creating Enterprise sku Spring resource.
* Add new command group `az spring application-accelerator customized-accelerator` to manage Customized Accelerator.
Expand Down
9 changes: 7 additions & 2 deletions src/spring/azext_spring/_buildservices_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def build_and_get_result(self, total_steps, **kwargs):
uploader_selector(cli_ctx=self.cmd.cli_ctx, upload_url=upload_info.upload_url, **kwargs).upload_and_build(**kwargs)
logger.warning("[3/{}] Creating or Updating build '{}'.".format(total_steps, kwargs['app']))
build_result_id = self._queue_build(upload_info.relative_path, **kwargs)
logger.warning("[4/{}] Waiting for building docker image to finish. This may take a few minutes.".format(total_steps))
logger.warning("[4/{}] Waiting for building container image to finish. This may take a few minutes.".format(total_steps))
self._wait_build_finished(build_result_id)
return build_result_id

Expand Down Expand Up @@ -105,7 +105,12 @@ def _wait_build_finished(self, build_result_id):

if result.properties.provisioning_state != "Succeeded":
log_url = self._try_get_build_log_url(build_result_id)
raise DeploymentError("Failed to build docker image, please check the build logs {} and retry.".format(log_url))
if hasattr(result.properties, "error"):
build_error = result.properties.error
error_msg = "Failed to build container image, error code: {}, message: {}, check the build logs {} for more details and retry.".format(build_error.code, build_error.message, log_url)
else:
error_msg = "Failed to build container image, please check the build logs {} and retry.".format(log_url)
raise DeploymentError(error_msg)

def _get_build_result(self, id):
resource_id = parse_resource_id(id)
Expand Down
2 changes: 1 addition & 1 deletion src/spring/azext_spring/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def load_command_table(self, _):
exception_handler=handle_asc_exception) as g:
g.custom_command('tail', 'app_tail_log')

with self.command_group('spring app', custom_command_type=app_command, client_factory=cf_spring_20220501preview,
with self.command_group('spring app', custom_command_type=app_command, client_factory=cf_spring_20221101preview,
exception_handler=handle_asc_exception) as g:
g.custom_command('deploy', 'app_deploy', supports_no_wait=True)

Expand Down

Large diffs are not rendered by default.

1,388 changes: 789 additions & 599 deletions src/spring/azext_spring/tests/latest/recordings/test_deploy_app.yaml

Large diffs are not rendered by default.

Loading