Closed ferricoxide closed 5 months ago
@lorengordon: not sure why the Travis-based test is throwing an "unformatted" HCL error? When I run packer validate
, locally, It comes up green. That said, I'm doing:
/usr/local/bin/packer validate \
-only amazon-ebs.minimal-rhel-7-hvm,amazon-ebs.minimal-centos-7-hvm,amazon-ebs.minimal-rhel-8-hvm,amazon-ebs.minimal-centos-8stream-hvm,amazon-ebs.minimal-ol-8-hvm \
-var "spel_identifier=spel-test" \
-var "spel_version=2024.01.1-issue_658-01" \
./minimal-linux.pkr.hcl
Which results in:
The configuration is valid.
To validate.
@lorengordon: not sure why the Travis-based test is throwing an "unformatted" HCL error? When I run
packer validate
, locally, It comes up green. That said, I'm doing:
validate
is not the same as "format". Try packer fmt -recursive
and commit the change.
@lorengordon: not sure why the Travis-based test is throwing an "unformatted" HCL error? When I run
packer validate
, locally, It comes up green. That said, I'm doing:
validate
is not the same as "format". Trypacker fmt -recursive
and commit the change.
$ /usr/local/bin/packer fmt -recursive spel
$ echo $?
0
$ /usr/local/bin/packer --version
1.8.7
Try make -f Makefile.tardigrade-ci hcl/format
. That'll actually use terraform under the covers to format any hcl file, same as the way hcl/lint
works. Terraform fmt must be a little more fascist than packer fmt.
$ /usr/local/bin/packer fmt -recursive spel $ echo $? 0 $ /usr/local/bin/packer --version 1.8.7
Ah. Ok. Apparently, there was extra whitespace it didn't like. After running the make
:
$ git diff
diff --git a/spel/minimal-linux.pkr.hcl b/spel/minimal-linux.pkr.hcl
index a511582..60aee4c 100644
--- a/spel/minimal-linux.pkr.hcl
+++ b/spel/minimal-linux.pkr.hcl
@@ -931,7 +931,7 @@ build {
}
provisioner "shell" {
- execute_command = "{{ .Vars }} sudo -E /bin/sh '{{ .Path }}'"
+ execute_command = "{{ .Vars }} sudo -E /bin/sh '{{ .Path }}'"
scripts = [
"${path.root}/scripts/free-root.sh",
]
go codebuild go
Fixes #658