generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate plugin from the packer-sdc plugin-validate command (#45)
* install packer-sdc at the version from deps * go get github.com/hashicorp/packer-plugin-sdk@v0.2.8 * goreleaser: run plugin-check before release
- Loading branch information
Showing
4 changed files
with
23 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
NAME=osc | ||
NAME=outscale | ||
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 ./... | ||
|
||
ci-release-docs: | ||
@go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@latest | ||
@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} | ||
|
||
run-example: dev | ||
@packer build ./example | ||
|
||
test: | ||
@go test -count $(COUNT) $(TEST) -timeout=3m | ||
@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: install-packer-sdc | ||
@packer-sdc renderdocs -src docs -partials docs-partials/ -dst docs/ | ||
@/bin/sh -c "[ -d docs ] && zip -r docs.zip docs/" | ||
|
||
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 ./... | ||
packer-sdc renderdocs -src ./docs -dst ./.docs -partials ./docs-partials | ||
# checkout the .docs folder for a preview of the docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters