From faceed3e70c21c61363c3fae28921b49a8135692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulises=20Gasc=C3=B3n?= Date: Sun, 1 Sep 2024 01:08:15 +0200 Subject: [PATCH] ci: add validation per Packer template file individually https://github.com/nodejs/build/issues/3686 --- .github/workflows/orka-templates.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/orka-templates.yml b/.github/workflows/orka-templates.yml index a124024a5..7f5caa311 100644 --- a/.github/workflows/orka-templates.yml +++ b/.github/workflows/orka-templates.yml @@ -35,10 +35,13 @@ jobs: SSH_TEST_PASSWORD: 'mock-ssh-test-password' SSH_TEST_PUBLIC_KEY: 'mock-ssh-test-public-key' run: | - packer validate -var "orka_endpoint=$ORKA_ENDPOINT" \ - -var "orka_auth_token=$ORKA_AUTH_TOKEN" \ - -var "ssh_default_username=$SSH_DEFAULT_USERNAME" \ - -var "ssh_default_password=$SSH_DEFAULT_PASSWORD" \ - -var "ssh_test_public_key=$SSH_TEST_PASSWORD" \ - -var "ssh_userssh_test_passwordname=$SSH_TEST_PUBLIC_KEY" . + for file in $(find . -name '*.pkr.hcl'); do + echo "Validating $file" + packer validate -var "orka_endpoint=$ORKA_ENDPOINT" \ + -var "orka_auth_token=$ORKA_AUTH_TOKEN" \ + -var "ssh_default_username=$SSH_DEFAULT_USERNAME" \ + -var "ssh_default_password=$SSH_DEFAULT_PASSWORD" \ + -var "ssh_test_public_key=$SSH_TEST_PASSWORD" \ + -var "ssh_userssh_test_passwordname=$SSH_TEST_PUBLIC_KEY" $file || exit 1 + done working-directory: orka/templates \ No newline at end of file