forked from dmacvicar/terraform-provider-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'dmacvicar/main' into main
- Loading branch information
Showing
17 changed files
with
160 additions
and
220 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
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,33 +1,52 @@ | ||
TEST?=$$(go list ./... | grep -v 'vendor') | ||
HOSTNAME=github.com | ||
NAMESPACE=matthewjohn | ||
NAME=libvirt | ||
LDFLAGS += -X version.ProviderVersion=$$(git describe --always --abbrev=40 --dirty) | ||
|
||
:w | ||
:q | ||
:w | ||
:q | ||
:q! | ||
BINARY=terraform-provider-${NAME} | ||
VERSION=0.0.1 | ||
OS_ARCH=linux_amd64 | ||
# default args for tests | ||
TEST_ARGS_DEF := -covermode=count -coverprofile=profile.cov | ||
|
||
default: install | ||
default: build | ||
|
||
build: | ||
go build -o ${BINARY} | ||
terraform-provider-libvirt: | ||
go build -ldflags "${LDFLAGS}" | ||
|
||
release: | ||
goreleaser release --rm-dist --snapshot --skip-publish --skip-sign | ||
build: terraform-provider-libvirt | ||
|
||
install: build | ||
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} | ||
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} | ||
install: | ||
go install -ldflags "${LDFLAGS}" | ||
|
||
test: | ||
go test -i $(TEST) || exit 1 | ||
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 | ||
# unit tests | ||
# usage: | ||
# - run all the unit tests: make test | ||
# - run some particular test: make test TEST_ARGS="-run TestAccLibvirtDomain_Cpu" | ||
test: | ||
go test -v $(TEST_ARGS_DEF) $(TEST_ARGS) ./libvirt/... | ||
|
||
testacc: | ||
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m | ||
# acceptance tests | ||
# usage: | ||
# | ||
# - run all the acceptance tests: | ||
# make testacc | ||
# | ||
# - run some particular test: | ||
# make testacc TEST_ARGS="-run TestAccLibvirtDomain_Cpu" | ||
# | ||
# - run all the network test with a verbose loglevel: | ||
# TF_LOG=DEBUG make testacc TEST_ARGS="-run TestAccLibvirtNet*" | ||
# | ||
testacc: | ||
./travis/run-tests-acceptance $(TEST_ARGS) | ||
|
||
golangcilint: | ||
golangci-lint run | ||
|
||
tflint: | ||
terraform fmt -write=false -check=true -diff=true examples/ | ||
|
||
lint: golangcilint tflint | ||
|
||
clean: | ||
rm -f terraform-provider-libvirt | ||
|
||
cleanup: | ||
./travis/cleanup.sh | ||
|
||
.PHONY: build install test testacc tflint golangcilint lint terraform-provider-libvirt |
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
Oops, something went wrong.