Skip to content

Commit

Permalink
Update make targets to match scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
nywilken committed Aug 2, 2023
1 parent 7bc0d72 commit 84944af
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,38 @@ BINARY=packer-plugin-${NAME}

COUNT?=1
TEST?=$(shell go list ./...)
HASHICORP_PACKER_PLUGIN_SDK_VERSION?=$(shell go list -m github.com/hashicorp/packer-plugin-sdk | cut -d " " -f2)

.PHONY: dev

build:
@go build -o ${BINARY}

generate:
@go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@latest
@go generate -v ./...
dev: build
@mkdir -p ~/.packer.d/plugins/
@mv ${BINARY} ~/.packer.d/plugins/${BINARY}

test:
@go test -race -count $(COUNT) $(TEST) -timeout=3m

install-packer-sdc: ## Install packer sofware development command
@go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@${HASHICORP_PACKER_PLUGIN_SDK_VERSION}

ci-release-docs:
@go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@latest
ci-release-docs: install-packer-sdc
@packer-sdc renderdocs -src docs -partials docs-partials/ -dst docs/
@/bin/sh -c "[ -d docs ] && zip -r docs.zip docs/"

dev: build
@mkdir -p ~/.packer.d/plugins/
@mv ${BINARY} ~/.packer.d/plugins/${BINARY}
plugin-check: install-packer-sdc build
@packer-sdc plugin-check ${BINARY}

testacc: dev
@PACKER_ACC=1 go test -count $(COUNT) -v $(TEST) -timeout=120m

generate: install-packer-sdc
@go generate ./...

run-example: dev
@packer build ./example

run-hashicups-api:
@cd example/hashicups_api && docker-compose up -d

test:
@go test -count $(COUNT) $(TEST) -timeout=3m

testacc: dev
@PACKER_ACC=1 go test -count $(COUNT) -v $(TEST) -timeout=120m

0 comments on commit 84944af

Please # to comment.