Skip to content

Commit

Permalink
Use packer plugins install --path to install development version (cir…
Browse files Browse the repository at this point in the history
…ruslabs#131)

With modern Packer, and Packer templates with required_plugins
sections, the plugins need to follow a specific folder structure
and also come with a sha256 hash of the plugin.

By using `packer plugins install --path` we can let Packer deal
with the specifics of installing a plugin from disk instead of
from a repository.

As a drive-by, update the version number in version.go to match
the latest tagged version. This version number should always
reflect the current version.
  • Loading branch information
torarnv authored Mar 15, 2024
1 parent 1d969c0 commit b1299dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ HASHICORP_PACKER_PLUGIN_SDK_VERSION?=$(shell go list -m github.com/hashicorp/pac
build:
@go build -o ${BINARY}

dev: build
@mkdir -p ~/.packer.d/plugins/
@mv ${BINARY} ~/.packer.d/plugins/${BINARY}
dev:
go build -ldflags="-X '${BINARY}/version.VersionPrerelease=dev'" -o ${BINARY}
packer plugins install --path ${BINARY} "github.com/cirruslabs/$(NAME)"

test:
@go test -race -count $(COUNT) $(TEST) -timeout=3m
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

var (
// Version is the main version number that is being run at the moment.
Version = "1.2.0"
Version = "1.10.0"

// VersionPrerelease is A pre-release marker for the Version. If this is ""
// (empty string) then it means that it is a final release. Otherwise, this
Expand Down

0 comments on commit b1299dd

Please sign in to comment.