From 23cd708bd01dff10cabb11b66f094b00c1351519 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 27 Jan 2022 21:45:51 -0500 Subject: [PATCH] Update HCL2 PackerConfig to call SetDebug mode for CoreBuild when --debug flag is passed ``` ~> packer build --debug /tmp/source.pkr.hcl Debug mode enabled. Builds will not be parallelized. null.example: output will be in this color. ==> null.example: Pausing after run of step 'StepConnect'. Press enter to continue. ==> null.example: Pausing before the next provisioner . Press enter to continue. ==> null.example: Running local shell script: /var/folders/vz/rv7bk6v15211jxg8q801f7kw0000gq/T/packer-shell4149319610 null.example: hi ==> null.example: Pausing before the next provisioner . Press enter to continue. ==> null.example: Running local shell script: /var/folders/vz/rv7bk6v15211jxg8q801f7kw0000gq/T/packer-shell3210691290 null.example: hi 2 ==> null.example: Pausing after run of step 'StepProvision'. Press enter to continue. ==> null.example: Pausing before cleanup of step 'StepProvision'. Press enter to continue. ==> null.example: Pausing before cleanup of step 'StepConnect'. Press enter to continue. Build 'null.example' finished after 8 seconds 284 milliseconds. ==> Wait completed after 8 seconds 284 milliseconds ==> Builds finished. The artifacts of successful builds are: --> null.example: Did not export anything. This is the null builder ``` --- hcl2template/types.packer_config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 2ceabda7135..d5816c2abad 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -609,6 +609,7 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Bu BuildName: build.Name, Type: srcUsage.String(), } + pcb.SetDebug(cfg.debug) // Apply the -only and -except command-line options to exclude matching builds. buildName := pcb.Name()