Commit Graph

369 Commits (ea2fdc25fa2701fae4b60259ccb7dac34afc5a13)

Author SHA1 Message Date
Megan Marsh ea1ac530b0 move hcl2template kv types into the config/custom_types with trilean definitions
6 years ago
Megan Marsh 9e47696dff move helper/config to bundle with the other template definitions
6 years ago
Megan Marsh 7d658149ea update tests and website and generated partials to reflect new package format
6 years ago
Megan Marsh 3e54e9ea80
Merge pull request #10235 from hashicorp/refactor_version_code
6 years ago
Wilken Rivera acabc1c1aa
Add packer fmt command (#10225)
6 years ago
Adrien Delorme deba1484ff
HCL2: allow calling env as input var default value (#10240)
6 years ago
Megan Marsh bc85854a53 refactor packer version out of hcltemplate code.
6 years ago
Adrien Delorme fd873b8811 Referenceable: explain a bit more of the whys
6 years ago
Adrien Delorme 10eb32d29e require less English
6 years ago
Adrien Delorme 2987d25335 simplify tests
6 years ago
Adrien Delorme 20b7fd9687 add hcl2template/addrs/doc.go
6 years ago
Adrien Delorme 971254928a various fixes
6 years ago
Adrien Delorme 88175873e5 fix tests to actually check cty values & types
6 years ago
Adrien Delorme 6911495fc4 add VariableAssignment struct that help describe an input var assignment
6 years ago
Adrien Delorme 8de2f40a07 add tests for length
6 years ago
Adrien Delorme b892414e84 add failing test case
6 years ago
Adrien Delorme 9932fd1217 add Variable.validateValue func
6 years ago
Adrien Delorme 4d386dd806 add length function that can work with more types
6 years ago
Adrien Delorme 4e08ea6a92 add a test
6 years ago
Adrien Delorme 91d7332471 add basic code for variable validation parsing
6 years ago
Adrien Delorme 4bc16455b4
HCL2: add a packer block with a required_version input setting (#10149)
6 years ago
Adrien Delorme 6d4fae0f2d
Add HCL2 aws_secretsmanager function (#10124)
6 years ago
Megan Marsh cc7dbf6092
Add consul_key function to integrate concul with hcl2 tempaltes. (#10119)
6 years ago
Megan Marsh a8ee23a9f9
Merge pull request #10117 from hashicorp/packer_version_func_hcl
6 years ago
Megan Marsh 09c6d2880f implement packer_version variable in hcl
6 years ago
Megan Marsh 66b81d9bee
add build.name to hcl code (#10114)
6 years ago
Adrien Delorme 4cb218749b remove unecessary check
6 years ago
Adrien Delorme ebb1cb406c ignore walk error
6 years ago
Adrien Delorme bb22cfcf34 HCL2: pass sensitive variables to packer.LogSecretFilter
6 years ago
Adrien Delorme 180dc4a54e add test
6 years ago
Adrien Delorme f3e65b5eb1 use "github.com/hashicorp/go-cty-funcs/collection".CoalesceFunc
6 years ago
Adrien Delorme a70164f489
HCL2: when the type of a variable is not known evaluate setting as a litteral. (#9863)
6 years ago
Adrien Delorme bdf198594e hcl2 inspect: sort variables to have a consistent output
6 years ago
Adrien Delorme eb4069a1b7 hcl variables: return an unknown value in when no default is set
6 years ago
Adrien Delorme 91c5a4613c HCL2 inspect remove debug values
6 years ago
Adrien Delorme 5ba134ac5b
JSON to HCL2 (minimal best-effort) transpiler (#9659)
6 years ago
Megan Marsh d486459a00
Merge pull request #9764 from hashicorp/hcl2_provisioner_override
6 years ago
sylviamoss 62c3743890 implemet override provisioner's option for hcl2
6 years ago
jsmcnair 78c280b1b7 Use common funcs / fix panic / clarify docs
6 years ago
jsmcnair 33e3f62ff7 Add vault function for HCL2 and document
6 years ago
Sylvia Moss 9181a435aa
Make max_retries a string to allow variable interpolation (#9673)
6 years ago
Megan Marsh 2bd2954412 fix cty bool passing for provisioners, too
6 years ago
Megan Marsh 713e7a2683 fix docker-import postprocessor.
6 years ago
Adrien Delorme c7b35dd6bc
HCL2: add post-processors block to run multiple post-processor after a build (#9638)
6 years ago
Adrien Delorme 44616d3bff
refactor initialization out from packer configs + tests (#9627)
6 years ago
Adrien Delorme 125178d943
core: Decode: when in HCL2 decoding mode; reset the whole struct before preparing it. (#9622)
6 years ago
Adrien Delorme f3fa8cd617 post-processor/provisioner: handle uint64 buildvars
6 years ago
Sylvia Moss 9c1409dbba
Add content_library_destination to import VM template to a Content Library (#9551)
6 years ago
Adrien Delorme 03d29386dd
fix error message typo (#9541)
6 years ago
Adrien Delorme 34ff3d0c8f hcl2 GetBuilds: use packer.BuilderDataCommonKeys to avoid forcing all builders to return exactly what they will return
6 years ago
Adrien Delorme 0293f69fa1 default build values to be unknown
6 years ago
Adrien Delorme eaf63e3bb5 pass source name from local source name too
6 years ago
Adrien Delorme cf514d31f2 avoid passing generatedVars down during first prepare
6 years ago
Adrien Delorme 0ed10f921f add test
6 years ago
Adrien Delorme 90610dcf04 docs
6 years ago
Adrien Delorme 39261f3671 add hcl2 post processor type that reprepares itself
6 years ago
Adrien Delorme db6c3adbba add hcl2 provisioner type that reprepares itself
6 years ago
Adrien Delorme 284d46a1e0 WIP
6 years ago
Adrien Delorme 7969b690de Revert "Share build info with Provisioner and Post-Processor via HCL2 variables (#9444)"
6 years ago
Adrien Delorme 3d371a2d5d
Add complete HCL2 examples + allow to name a singular build.source blocks (#9490)
6 years ago
Sylvia Moss 99046c9178
Share build info with Provisioner and Post-Processor via HCL2 variables (#9444)
6 years ago
Adrien Delorme c2975140cf
HCL2: allow to use keep_input_artifact in post processors (#9477)
6 years ago
Adrien Delorme 6f4d79799b add thorough test
6 years ago
Adrien Delorme 51d02f8c2d hcl2: inspect command
6 years ago
Adrien Delorme a96a8f22b9 HCL2: allow to describe a build block
6 years ago
Adrien Delorme fb337f8867
hcl work on only/except (#9454)
6 years ago
Moss daaeccd8b0 Skip consecutives post-processors
6 years ago
Moss 6599e7ab05 apply goimports
6 years ago
Moss bfb9df0039 fix except flag for JSON and HCL2
6 years ago
Adrien Delorme cf6eca7e1c Revert "Add pwd function to HCL"
6 years ago
Adrien Delorme 44dfa221de Revert "Add template_dir function to HCL"
6 years ago
Megan Marsh d73f83a9d9
Merge pull request #9367 from jeremiahsnapp/add-template_dir-and-pwd-functions
6 years ago
Wilken Rivera f672f5bd9b command/validate: Add support for HCL2 configuration files
6 years ago
Jeremiah Snapp 3b9a0427cd Add template_dir function to HCL
6 years ago
Jeremiah Snapp 2800043149 Add pwd function to HCL
6 years ago
Adrien Delorme bac9c74447
packer console for HCL2 (#9359)
6 years ago
Jeremiah Snapp 0d7c5dc670
Enable only/except for provisioners and post-processors (#9357)
6 years ago
Adrien Delorme f09fd790b7
Merge branch 'master' into master
6 years ago
Adrien Delorme 1147ef9a36
Merge pull request #9291 from hashicorp/f-singular-build-source-blocks
6 years ago
Adrien Delorme 6a406ffb1d
Update hcl2template/types.source.go
6 years ago
Adrien Delorme 225081c3a6
Update hcl2template/types.source.go
6 years ago
Adrien Delorme b4aa71aef2 Merge remote-tracking branch 'origin/master' into pr/AdrienneCohea/9245
6 years ago
Adrien Delorme 059a782b0e remove debug log
6 years ago
Adrien Delorme 8a13dd3073 HCL2: Make the `build`.`sources` argument list optional
6 years ago
Adrien Delorme 40947c2bf6
HCL2: generate hcl tags with go-cty tags too (#9306)
6 years ago
Megan Marsh 3dc4ba2d68
Json vs HCL2 parity refactor (#9301)
6 years ago
Adrien Delorme 125ffe36c3 Allow to override some source fields from the build section
6 years ago
Megan Marsh 24dd7e9dbb
Merge pull request #9257 from hashicorp/azr-hcl2-use-source-type-and-name
6 years ago
Adrien Delorme 1ddf2a7d05 Update types.packer_config_test.go
6 years ago
Adrien Delorme d431db0a38 HCL2: use source type and name as Name of a CoreBuild
6 years ago
Adrienne Cohea 6c6039798c
Add test.
6 years ago
Adrienne Cohea 6aea8ead6a
Support named builds in HCL2 templates.
6 years ago
Megan Marsh ee5635722b enable force, debug, and on-error for hcl2 builds
6 years ago
Adrien Delorme 1f3e85185e Update types.packer_config.go
6 years ago
Adrien Delorme 0062160581 Update common_test.go
6 years ago
Adrien Delorme 42a05e1e80 more refactoring
6 years ago
Adrien Delorme 526d040534 document Parser.Parse better
6 years ago
Adrien Delorme 5c2b8da63b get builds from PackerConfig instead of parser
6 years ago
Adrien Delorme 2df21496b3 hcl2template: let PackerConfig actually start a builder/provisioner/post-processor
6 years ago
Adrien Delorme a3343c1848 Delete zz_retrocompat.go
6 years ago
Tom Dyas c0a6623ea2
teach HCL mode builds to honor -only and -except options (#8947)
6 years ago
Adrien Delorme 73242e8de4 make sure keyvalue and namevalue filters are using the same naming as the service being used
6 years ago
Sylvia Moss 553b1fb9f8
Add RetriedProvisioner to allow retry provisioners (#9061)
6 years ago
Adrien Delorme 840e67f775
HCL2: when we see a map generate an attribute spec instead of a block spec (#9035)
6 years ago
Adrien Delorme 2af40c762b
HCL2: pass on builder type and name (#8956)
6 years ago
Jeff Escalante 9165be87da
packer.io prefix removal, html extension remove for in-code errors
6 years ago
Adrien Delorme d068430abf
make sure locals are evaluated only once variables are + test this (#8918)
6 years ago
Adrien Delorme ad8dafa3bd
HCL: add tests and fixes around var-file and var args (#8914)
6 years ago
Adrien Delorme 88297c796d Merge branch 'master' into hcl2_singular_blocks
6 years ago
Adrien Delorme 3beea4fb94 NameValues.CopyOn: don't instanciate a receiving map if there is nothing to copy over
6 years ago
Adrien Delorme b5e8750f5f Change key/value to name/value to remain consistent with Terraform
6 years ago
Adrien Delorme c845436e32 KeyValues.CopyOn: make sure a receiving nil map is set too
6 years ago
Adrien Delorme 87d6b2433f make generate
6 years ago
Adrien Delorme 6e6490d688 WIP
6 years ago
Adrien Delorme af38430eb8 add kvfilter type that regroups very frequently used filters
6 years ago
Adrien Delorme 9e6d5da277 hcl2: add general kv store that could be used anywhere
6 years ago
Adrien Delorme c9ec967205 better testing
6 years ago
Adrien Delorme 710ebdcef5 add more test for var files
6 years ago
Adrien Delorme c8300b620a allow to use hcl files as var files in HCL mode
6 years ago
zac 79f1fab836
hcl2template/types: add spaces in error messages. (#8881)
6 years ago
Megan Marsh e518a0a8b7
Merge branch 'master' into update_go-cty_regex
6 years ago
Adrien Delorme 0c45bd8b4f import new replace and regex replace funcs from go-cty + documentation
6 years ago
Adrien Delorme 631f402d1e Merge branch 'master' into fix_8730
6 years ago
Adrien Delorme 0ccff0d5b9 all variables must have a value.
6 years ago
Adrien Delorme 6d8cce501e tweak validation & add tests
6 years ago
Wilken Rivera 9403b48a52
hcl2template/types.variables: Update logic for parsing literal value variables (#8834)
6 years ago
Adrien Delorme e9d3826219 variables: use Range instead of Block
6 years ago
Adrien Delorme 9b649594c6 update tests
6 years ago
Adrien Delorme 8482c6c2e6 evaluateLocalVariable: also pass the variable name
6 years ago
Adrien Delorme bd3112fa7c parseLocalVariables: simplify loop
6 years ago
Adrien Delorme 23b940dbd5 fix this !
6 years ago
Adrien Delorme e851050774 don't force to set unused variables too
6 years ago
Adrien Delorme 382f209b07 Update types.packer_config.go
6 years ago
Adrien Delorme 59cc246942 Merge remote-tracking branch 'origin/master' into fix_8730
6 years ago
Adrien Delorme 50896d4ddf WIP
6 years ago
Sylvia Moss 591b684f08
Fix HCL2 local variables decoding to allow local usage within another local in the same locals block (#8755)
6 years ago
Adrien Delorme a8fcb2d91a
HCL2: add support for dynamic blocks, document for loops and splat expressions (#8720)
6 years ago
Adrien Delorme 52e5b7051e Update mock.go
6 years ago
Adrien Delorme 3c213e6eaf continue and realise and unused undefaulted value triggers an error
6 years ago
Adrien Delorme cebfb1c735 give correct error when variable is unset
6 years ago
Adrien Delorme 79867ca26e add test for unset variable
6 years ago
Adrien Delorme 00c812cfe8 insert "github.com/zclconf/go-cty/cty/json" encoding beforce hcl decoding things to make sure tests are working similarly as real life version
6 years ago
Adrien Delorme 1ec68cac23 refactor prepare into MockConfig
6 years ago
Sylvia Moss 2981fd627d
Avoid calling CoreBuild.Prepare(...) for HCL2 templates (#8742)
6 years ago
Adrien Delorme 4b10c5a87c try to reproduce #8730 in tests
6 years ago
Adrien Delorme 193dad46e6
Hcl2 input variables, local variables and functions (#8588)
6 years ago
Sylvia Moss 08b0bd1d2c
Fix HCL2 code generation for slices within another slice (#8669)
6 years ago
nywilken d2a9e6b32e Format code with `gofmt -s -w`
6 years ago
Adrien Delorme 2d1a67c6cb hcl2: allow to optionnaly name provisioners and post-processors
6 years ago
Adrien Delorme 13ea97a1df mapstructure-to-hcl2: make basic named types pointers ( optional )
6 years ago
Adrien Delorme d8c3385814 hcl2template/mock.go: add fields with named types
6 years ago
Adrien Delorme 79d7b3e636 regroup duplicate error message
6 years ago
Adrien Delorme 0102f5b6fa remove unecessary inexistant block panic + add test
6 years ago
Adrien Delorme 219c80b1e6 better empty folder test
6 years ago
Adrien Delorme aad90842b4 add test case and fix the breaking ones
6 years ago
Adrien Delorme d8c33bc59e HCL: deshadown warnings from Parser.Parse
6 years ago
Adrien Delorme 5ef1893b00 fix crash when build.sources is set to an invalid name
6 years ago
Megan Marsh 5bacd37014 fix pps
6 years ago
Megan Marsh dca2c03cdb
Merge pull request #7866 from hashicorp/sharing_info
6 years ago
Megan Marsh 25711ed7d0 make HCL2 respect the new builder-returned generated vars list
6 years ago
Adrien Delorme ee2d74ce9e
hcl2template/common_test.go: make testParse a helper (#8495)
6 years ago
Adrien Delorme bc49234930 remove old untrue comment
6 years ago
Adrien Delorme 50fb1148b4 wip
6 years ago
Adrien Delorme 0785c2f6fc
build using HCL2 (#8423)
6 years ago
Adrien Delorme bf3d9841c6 Force durations to be passed a strings
7 years ago
Adrien Delorme 4479f73995 uncomment duplicate check tests
7 years ago
Adrien Delorme 0e4fec03d7 make complete tests files link as windows can't handle synlinks
7 years ago
Adrien Delorme 21a0cbffba fmt
7 years ago
Adrien Delorme 2b0e0d4eab add hcl2template pkg
7 years ago