packer-cn/command
Adrien Delorme 5ba134ac5b
JSON to HCL2 (minimal best-effort) transpiler (#9659)
hcl2_upgrade transforms a JSON build-file in a HCL2 build-file.
This starts a validated Packer core and from that core we generate an HCL 'block' per plugin/configuration. So for a builder, a provisioner, a post-processor or a variable. The contents of each block is just transformed as is and basically all fields are HCL2-ified.
A generated field can be valid in JSON but invalid on HCL2; for example JSON templating (in mapstructure) allows to set arrays of strings - like `x = ["a", "b"]` - with single strings - like `x="a"` -, HCL does not allow this.
Since JSON does not make the distinction between variables and locals, everything will be a variable. So variables that use other variables will not work.
hcl2_upgrade tries to transform go templating interpolation calls to HCL2 calls when possible, leaving the go templating calls like they are in case it cannot.

Work:
* transpiler
* tests
* update hcl v2 library so that output looks great.
* update docs
2020-08-25 10:51:43 +02:00
..
test-fixtures JSON to HCL2 (minimal best-effort) transpiler (#9659) 2020-08-25 10:51:43 +02:00
build.go Pretty print build durations 2020-08-11 15:04:42 -07:00
build_cancellation_test.go fix tests 2020-05-08 17:46:33 +02:00
build_cleanup_script_test.go fix tests 2020-05-08 17:46:33 +02:00
build_parallel_test.go fix tests 2020-05-08 17:46:33 +02:00
build_test.go add tests and update override example 2020-08-14 11:22:51 +02:00
build_timeout_test.go build using HCL2 (#8423) 2019-12-17 11:25:56 +01:00
build_windows_test.go Update build_windows_test.go 2020-07-07 12:00:36 +02:00
cli.go JSON to HCL2 (minimal best-effort) transpiler (#9659) 2020-08-25 10:51:43 +02:00
command_test.go add a complete tests for builder variables + only/except 2020-07-06 17:01:55 +02:00
configtype_enumer.go packer console for HCL2 (#9359) 2020-06-05 17:23:54 +02:00
console.go refactor initialization out from packer configs + tests (#9627) 2020-07-24 10:58:03 +02:00
console_test.go core: Decode: when in HCL2 decoding mode; reset the whole struct before preparing it. (#9622) 2020-07-23 09:25:07 +02:00
core_wrapper.go refactor initialization out from packer configs + tests (#9627) 2020-07-24 10:58:03 +02:00
exec_test.go JSON to HCL2 (minimal best-effort) transpiler (#9659) 2020-08-25 10:51:43 +02:00
fix.go update fix command with new synthax 2020-05-12 11:33:44 +02:00
fix_test.go Move fixer test to fix package 2019-07-24 18:04:17 +01:00
hcl2_upgrade.go JSON to HCL2 (minimal best-effort) transpiler (#9659) 2020-08-25 10:51:43 +02:00
hcl2_upgrade_test.go JSON to HCL2 (minimal best-effort) transpiler (#9659) 2020-08-25 10:51:43 +02:00
inspect.go refactor initialization out from packer configs + tests (#9627) 2020-07-24 10:58:03 +02:00
inspect_test.go HCL2: add post-processors block to run multiple post-processor after a build (#9638) 2020-07-28 10:02:37 +02:00
meta.go JSON to HCL2 (minimal best-effort) transpiler (#9659) 2020-08-25 10:51:43 +02:00
plugin.go Add yandex-import post-processor 2020-07-08 22:01:52 +03:00
signal.go refactor term interrupts & have RunContext take a conf struct now 2020-05-08 12:05:14 +02:00
utils.go build using HCL2 (#8423) 2019-12-17 11:25:56 +01:00
validate.go refactor initialization out from packer configs + tests (#9627) 2020-07-24 10:58:03 +02:00
validate_test.go refactor initialization out from packer configs + tests (#9627) 2020-07-24 10:58:03 +02: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