• Adrien Delorme's avatar
    build using HCL2 (#8423) · 0785c2f6
    Adrien Delorme authored
    This follows #8232 which added the code to generate the code required to parse
    HCL files for each packer component.
    
    All old config files of packer will keep on working the same. Packer takes one
    argument. When a directory is passed, all files in the folder with a name
    ending with  “.pkr.hcl” or “.pkr.json” will be parsed using the HCL2 format.
    When a file ending with “.pkr.hcl” or “.pkr.json” is passed it will be parsed
    using the HCL2 format. For every other case; the old packer style will be used.
    
    ## 1. the hcl2template pkg can create a packer.Build from a set of HCL (v2) files
    
    I had to make the packer.coreBuild (which is our one and only packer.Build ) a public struct with public fields
    
    ## 2. Components interfaces get a new ConfigSpec Method to read a file from an HCL file.
    
      This is a breaking change for packer plugins.
    
    a packer component can be a: builder/provisioner/post-processor
    
    each component interface now gets a `ConfigSpec() hcld...
    0785c2f6