From ac84292e7678aad017df64ce10637488c6ea05c3 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:27:56 -0400 Subject: [PATCH] Makefile: make dev uses packer for install (#184) When building the development version of the plugin, we now use `packer plugins install` for that instead of moving it to the plugins directory manually. This target will require Packer 1.10.2 and above to function, as prior versions don't support instaling pre-release versions of a plugin with that command. --- .github/workflows/test-plugin-e2e.yaml | 12 +++++++----- Makefile | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-plugin-e2e.yaml b/.github/workflows/test-plugin-e2e.yaml index 2502fe0..475c495 100644 --- a/.github/workflows/test-plugin-e2e.yaml +++ b/.github/workflows/test-plugin-e2e.yaml @@ -27,12 +27,12 @@ jobs: - name: Build packer plugin run: | cd $GITHUB_WORKSPACE - make dev + make build - uses: actions/upload-artifact@v4 with: name: packer-plugin-nutanix - path: ~/.config/packer/plugins/packer-plugin-nutanix + path: packer-plugin-nutanix retention-days: 7 - name: build test list @@ -70,11 +70,13 @@ jobs: name: packer-plugin-nutanix path: /tmp + - name: Fix plugin permissions + run: | + chmod +x /tmp/packer-plugin-nutanix + - name: Install plugin run: | - mkdir -p ~/.config/packer/plugins/ - cp /tmp/packer-plugin-nutanix ~/.config/packer/plugins/packer-plugin-nutanix - chmod 755 ~/.config/packer/plugins/packer-plugin-nutanix + packer plugins install --path /tmp/packer-plugin-nutanix "github.com/nutanix-cloud-native/nutanix" - name: Run `packer init` id: init diff --git a/Makefile b/Makefile index 0a81f60..a1a5bfa 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ NAME=nutanix BINARY=packer-plugin-${NAME} +PLUGIN_FQN="$(shell grep -E '^module'