From: Anil Belur Date: Wed, 2 Oct 2024 13:19:28 +0000 (+1000) Subject: Fix: if condition to check file ext X-Git-Tag: v0.90.10^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=377006dc60045be0a75f901bf95a2f86edf0c1a2;p=releng%2Fglobal-jjb.git Fix: if condition to check file ext Fix condition to check the file extension with packer build script. The packer init steps gets skipped when the condition fails with some filenames ex: mininet-ovs-2.8.pkr.hcl. Issue: RELENG-5574 Change-Id: I91b3b6270c62ee3a2c8f28c25be22b408657d840 Signed-off-by: Anil Belur --- diff --git a/releasenotes/notes/fix-if-condition-791277d5b3aae6fe.yaml b/releasenotes/notes/fix-if-condition-791277d5b3aae6fe.yaml new file mode 100644 index 00000000..0e6a738e --- /dev/null +++ b/releasenotes/notes/fix-if-condition-791277d5b3aae6fe.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix condition that check the file extension with packer build script. + The condition is skipped when long names ex: mininet-ovs-2.8.pkr.hcl diff --git a/shell/packer-build.sh b/shell/packer-build.sh index 7dd2434b..3f58021f 100644 --- a/shell/packer-build.sh +++ b/shell/packer-build.sh @@ -53,7 +53,7 @@ export PACKER_LOG="yes" export PACKER_LOG_PATH="$PACKER_BUILD_LOG" # download plugins only for HCL format -if [[ "${template_file#*.}" == "pkr.hcl" ]]; then +if [[ "${template_file#*.}" =~ .*pkr.hcl ]]; then echo "packer init ${template_file} ..." packer.io init "${template_file}" fi