@@ -162,10 +162,12 @@ def setup_command_context(
162162@click .argument ('stack_env' )
163163@add_common_options
164164@add_stackql_kwarg_options
165+ @click .option ('--output-file' , default = None ,
166+ help = 'File path to write deployment outputs as JSON.' )
165167@click .pass_context
166168def build (ctx , stack_dir , stack_env , log_level , env_file ,
167169 env , dry_run , show_queries , on_failure ,
168- custom_registry , download_dir ):
170+ custom_registry , download_dir , output_file ):
169171 """Create or update resources."""
170172
171173 from .cmd .build import StackQLProvisioner
@@ -184,7 +186,7 @@ def build(ctx, stack_dir, stack_env, log_level, env_file,
184186 f"to environment: [{ stack_env } ]" )
185187 print_unicode_box (message , BorderColor .YELLOW )
186188
187- provisioner .run (dry_run , show_queries , on_failure )
189+ provisioner .run (dry_run , show_queries , on_failure , output_file )
188190 click .echo ("🎯 dry-run build complete" if dry_run
189191 else "🚀 build complete" )
190192
@@ -232,9 +234,11 @@ def teardown(ctx, stack_dir, stack_env, log_level, env_file,
232234@click .argument ('stack_env' )
233235@add_common_options
234236@add_stackql_kwarg_options
237+ @click .option ('--output-file' , default = None ,
238+ help = 'File path to write deployment outputs as JSON.' )
235239@click .pass_context
236240def test (ctx , stack_dir , stack_env , log_level , env_file ,
237- env , dry_run , show_queries , on_failure , custom_registry , download_dir ):
241+ env , dry_run , show_queries , on_failure , custom_registry , download_dir , output_file ):
238242 """Run test queries for the stack."""
239243
240244 from .cmd .test import StackQLTestRunner
@@ -253,7 +257,7 @@ def test(ctx, stack_dir, stack_env, log_level, env_file,
253257 f"in environment: [{ stack_env } ]" )
254258 print_unicode_box (message , BorderColor .YELLOW )
255259
256- test_runner .run (dry_run , show_queries , on_failure )
260+ test_runner .run (dry_run , show_queries , on_failure , output_file )
257261 click .echo (f"🔍 tests complete (dry run: { dry_run } )" )
258262
259263#
0 commit comments