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 <abelur@linuxfoundation.org>
--- /dev/null
+---
+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
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