diff --git a/pyproject.toml b/pyproject.toml index 19baf3ed..ea2bfc87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "solutions-builder" -version = "1.17.17" +version = "1.17.18" description = "A solution framework to generate a project with built-in structure and modules" authors = ["Jon Chen "] license = "Apache" diff --git a/solutions_builder/cli/cli.py b/solutions_builder/cli/cli.py index ea96a382..d588d2bd 100644 --- a/solutions_builder/cli/cli.py +++ b/solutions_builder/cli/cli.py @@ -194,7 +194,6 @@ def deploy( for command in commands: exec_shell(env_var_str + command, working_dir=solution_path) - # Destory deployment. @app.command() def delete(profile: str = DEFAULT_DEPLOY_PROFILE, @@ -244,7 +243,7 @@ def info(solution_path: Annotated[Optional[str], print(f"{key}: {value}") print() - print(f"Installed components:") + print("Installed components:") for key, value in sb_yaml["components"].items(): print(f" - {key}") print() @@ -261,7 +260,7 @@ def version(): def main(): try: - print_highlight(f"Solutions Builder (version " + + print_highlight("Solutions Builder (version " + typer.style(__version__, fg=typer.colors.CYAN, bold=True) + ")\n") app() @@ -271,7 +270,9 @@ def main(): if DEBUG: traceback.print_exc() print_error(e) + return -1 + return 0 if __name__ == "__main__": main() diff --git a/solutions_builder/cli/cli_utils.py b/solutions_builder/cli/cli_utils.py index 8fcc6176..c13d7ca1 100644 --- a/solutions_builder/cli/cli_utils.py +++ b/solutions_builder/cli/cli_utils.py @@ -108,8 +108,8 @@ def exec_shell(command, working_dir=".", stop_when_error=True, stdout=None): exit_status = proc.wait() if exit_status != 0 and stop_when_error: - raise Exception( - f"Error when running command: {command} (working_dir={working_dir})") + raise RuntimeError( + f"Error occurs when running command: {command} (working_dir={working_dir})") return exit_status diff --git a/solutions_builder/cli/set.py b/solutions_builder/cli/set.py index ddabd7ec..54092eff 100644 --- a/solutions_builder/cli/set.py +++ b/solutions_builder/cli/set.py @@ -51,7 +51,7 @@ def project_id( skip=yes) # Update Root sb.yaml - new_project_number = int(get_project_number(new_project_id)) + new_project_number = get_project_number(new_project_id) assert new_project_number, "Unable to receive project number for project '{new_project_id}'" global_variables["project_id"] = new_project_id diff --git a/solutions_builder/template_root/sb.yaml b/solutions_builder/template_root/sb.yaml index 7d5bb141..dbdffb82 100644 --- a/solutions_builder/template_root/sb.yaml +++ b/solutions_builder/template_root/sb.yaml @@ -3,7 +3,7 @@ _metadata: components: {} created_at: "{% now 'utc', '%Y-%b-%d %H:%M:%S UTC' %}" modified_at: "{% now 'utc', '%Y-%b-%d %H:%M:%S UTC' %}" -project_number: {{project_number}} -project_id: {{project_id}} # sb-var:project_id -project_name: {{project_name}} # sb-var:project_name -global_variables: {} +global_variables: + project_number: {{project_number}} # sb-var:project_number + project_id: {{project_id}} # sb-var:project_id + project_name: {{project_name}} # sb-var:project_name