packer-cn/command
Wilken Rivera f672f5bd9b command/validate: Add support for HCL2 configuration files
* Update validate command to use FixConfig for checking against known
fixers
* Update validation command flag docs
* Add ConfigFixer method to PackerHandler Interface
* Implement ConfigFixer interface in PackerConfig
* Remove all stdout messaging (i.e calls to c.Ui.Say) in the validate
command. The command will only display hcl.Diagnotic messaging when there is an error or warning.

HCL2 Configs
```
⇶  packer validate docker_centos_shell_provisioner.pkr.hcl

```

JSON Configs
```
⇶  packer validate vmware-iso_ubuntu_minimal/vmware-iso_ubuntu_minimal.json
Error: Failed to prepare build: "vmware-iso"

1 error occurred:
        * Deprecated configuration key: 'iso_checksum_type'. Please call `packer fix`
against your template to update your template to be compatable with the current
version of Packer. Visit https://www.packer.io/docs/commands/fix/ for more
detail.

Warning: Fixable configuration found.
You may need to run `packer fix` to get your build to run correctly.
See debug log for more information.

  map[string]interface{}{
        "builders": []interface{}{
                map[string]interface{}{
                        ... // 3 identical entries
                        "guest_os_type":     string("ubuntu-64"),
                        "http_directory":    string("http"),
-                       "iso_checksum":
string("946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2"),
+                       "iso_checksum":
string("sha256:946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2"),
-                       "iso_checksum_type": string("sha256"),
                        "iso_url":
string("http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso"),
                        "shutdown_command":  string("echo 'vagrant' | sudo -S shutdown -P now"),
                        ... // 4 identical entries
                },
        },
  }
```
2020-06-05 14:24:39 -04:00
..
test-fixtures command/validate: Add support for HCL2 configuration files 2020-06-05 14:24:39 -04:00
build.go packer console for HCL2 (#9359) 2020-06-05 17:23:54 +02: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 Update build_test.go 2020-05-08 17:50:48 +02:00
build_timeout_test.go build using HCL2 (#8423) 2019-12-17 11:25:56 +01:00
cli.go packer console for HCL2 (#9359) 2020-06-05 17:23:54 +02:00
command_test.go move packer to hashicorp 2017-04-04 13:39:01 -07:00
configtype_enumer.go packer console for HCL2 (#9359) 2020-06-05 17:23:54 +02:00
console.go packer console for HCL2 (#9359) 2020-06-05 17:23:54 +02:00
console_test.go packer console for HCL2 (#9359) 2020-06-05 17:23:54 +02:00
exec_test.go packer console for HCL2 (#9359) 2020-06-05 17:23:54 +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
inspect.go make packer inspect not print sensitive variables. 2018-12-07 12:02:20 -08:00
meta.go Move vars from Meta to cla args; this forces us to use it in GetConfigFromJSON which in turn forces us into updating console and validate 2020-05-12 11:24:22 +02:00
plugin.go Add new 'yandex-export' post-processor 2020-04-27 02:20:30 +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 command/validate: Add support for HCL2 configuration files 2020-06-05 14:24:39 -04:00
validate_test.go command/validate: Add support for HCL2 configuration files 2020-06-05 14:24:39 -04: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