Skip to content

Instantly share code, notes, and snippets.

@arsdragonfly
Created March 19, 2026 17:55
Show Gist options
  • Select an option

  • Save arsdragonfly/8efc99c733f11c38dbf823358d0b52ed to your computer and use it in GitHub Desktop.

Select an option

Save arsdragonfly/8efc99c733f11c38dbf823358d0b52ed to your computer and use it in GitHub Desktop.
packer_plugin_install.sh
#!/bin/bash
PACKER_PLUGIN_AZURE_REPO_URL="https://github.com/hashicorp/packer-plugin-azure.git"
PACKER_PLUGIN_AZURE_BRANCH="main"
PACKER_PLUGIN_AZURE_CLONE_DIR="$(mktemp -d)/packer-plugin-azure"
echo "==> Cloning ${PACKER_PLUGIN_AZURE_REPO_URL} @ ${PACKER_PLUGIN_AZURE_BRANCH}"
git clone --depth 1 --branch "${PACKER_PLUGIN_AZURE_BRANCH}" "${PACKER_PLUGIN_AZURE_REPO_URL}" "${PACKER_PLUGIN_AZURE_CLONE_DIR}"
pushd "${PACKER_PLUGIN_AZURE_CLONE_DIR}"
echo "==> Building plugin"
go build -ldflags="-X 'github.com/hashicorp/packer-plugin-azure/version.VersionPrerelease=dev'" -o packer-plugin-azure
echo "==> Installing plugin into Packer"
packer plugins install --path packer-plugin-azure "github.com/hashicorp/azure"
echo "==> Installed successfully"
packer plugins installed
popd
# Clean up source
rm -rf "${PACKER_PLUGIN_AZURE_CLONE_DIR}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment