mirror of https://github.com/hashicorp/packer
core: Decode: when in HCL2 decoding mode; reset the whole struct before preparing it. (#9622)
* core: Decode when in HCL2 decoding mode; reset the whole struct before preparing it. * HCL2: add path variables + docs & tests Co-authored-by: Megan Marsh <megan@hashicorp.com>pull/9628/head
parent
1f6473b4c1
commit
125178d943
@ -0,0 +1 @@
|
||||
echo hello from the ${BUILDER} builder ${USER}
|
||||
@ -0,0 +1,13 @@
|
||||
source "null" "example" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
build {
|
||||
sources = [
|
||||
"source.null.example"
|
||||
]
|
||||
provisioner "shell-local" {
|
||||
script = "./${path.root}/test_cmd.cmd"
|
||||
environment_vars = ["USER=packeruser", "BUILDER=${upper(build.ID)}"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
source "null" "example" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
build {
|
||||
sources = [
|
||||
"source.null.example"
|
||||
]
|
||||
provisioner "shell-local" {
|
||||
script = "./${path.root}/hello.sh"
|
||||
environment_vars = ["USER=packeruser", "BUILDER=${upper(build.ID)}"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
echo hello from the %BUILDER% builder %USER%
|
||||
@ -0,0 +1,14 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Path Variables - HCL Configuration Language
|
||||
sidebar_title: Path Variables
|
||||
description: |-
|
||||
Special variables provide directory information. This page covers all path
|
||||
variables.
|
||||
---
|
||||
|
||||
# Path variables
|
||||
|
||||
- `path.cwd`: the directory from where Packer was started.
|
||||
|
||||
- `path.root`: the directory of the input HCL file or the input folder.
|
||||
Loading…
Reference in new issue