packer/command
Adrien Delorme 2af40c762b
HCL2: pass on builder type and name (#8956)
* sets `packer_build_name` and `packer_builder_type` variables for builder provisioners and post-processors in HCL2
* allows to use the new `${source.type}` and `${source.name}` variables in HCL2
* fixes #8932 

Note that the common.PackerConfig is used everywhere and was not set for HCL2, this had some implications: 

For #8923 you can see the issue here:

dde74232f2/builder/lxd/config.go (L61-L63)

More random examples of where this could cause an issue :

0785c2f6fc/provisioner/ansible-local/provisioner.go (L380-L381)

b4efd13a4d/builder/amazon/ebs/builder.go (L232-L236)



* [All references to PackerConfig.PackerBuildName](https://sourcegraph.com/github.com/hashicorp/packer@ff6a039d5bb45e34ff761d9c52e8b98972288447/-/blob/common/packer_config.go#L7:2&tab=references)

* [All references to PackerConfig.PackerBuilderType](https://sourcegraph.com/github.com/hashicorp/packer@ff6a039d5bb45e34ff761d9c52e8b98972288447/-/blob/common/packer_config.go#L8:2&tab=references)
2020-04-09 11:14:37 +02:00
..
test-fixtures HCL2: pass on builder type and name (#8956) 2020-04-09 11:14:37 +02:00
build.go allow to use hcl files as var files in HCL mode 2020-03-12 15:41:40 +01:00
build_cancellation_test.go add more cancellation tests 2019-05-06 16:29:35 +02:00
build_cleanup_script_test.go add test for error-cleanup provisioner, and fix tests by fixing null builder to use an actual none communicator instead of skipping communicator generation altogether 2019-09-25 13:39:09 -07:00
build_parallel_test.go go fmt 2020-03-17 12:05:37 +01:00
build_test.go HCL2: pass on builder type and name (#8956) 2020-04-09 11:14:37 +02:00
build_timeout_test.go build using HCL2 (#8423) 2019-12-17 11:25:56 +01:00
command_test.go move packer to hashicorp 2017-04-04 13:39:01 -07:00
console.go document that the -var-file option still expects JSON files for now 2020-03-03 17:19:51 +01:00
fix.go Ensure help output is consistently formatted 2019-07-24 17:41:57 +01:00
fix_test.go Move fixer test to fix package 2019-07-24 18:04:17 +01:00
inspect.go make packer inspect not print sensitive variables. 2018-12-07 12:02:20 -08:00
meta.go make sure cli vars supercede var files (#8964) 2020-03-30 10:31:59 +02:00
plugin.go Fixing the linting errors now required for merging 2020-04-02 17:22:16 -07:00
utils.go build using HCL2 (#8423) 2019-12-17 11:25:56 +01:00
validate.go document that the -var-file option still expects JSON files for now 2020-03-03 17:19:51 +01:00
validate_test.go Updated test to verify expected behavior 2015-07-13 19:32:28 -07:00
version.go packer.io prefix removal, html extension remove for in-code errors 2020-04-07 17:53:22 -04:00
version_test.go command: version tests 2014-10-27 20:58:44 -07:00