packer-cn/Makefile

57 lines
1.5 KiB
Makefile
Raw Normal View History

TEST?=./...
2013-05-07 14:39:32 -04:00
default: test vet dev
2013-03-23 03:48:20 -04:00
bin:
@sh -c "$(CURDIR)/scripts/build.sh"
2013-09-17 07:35:07 -04:00
dev:
@TF_DEV=1 sh -c "$(CURDIR)/scripts/build.sh"
2013-08-13 21:42:08 -04:00
2015-05-26 16:26:22 -04:00
# generate runs `go generate` to build the dynamically generated
# source files.
generate:
go generate ./...
test:
@echo "Running tests on:"; git symbolic-ref HEAD; git rev-parse HEAD
go test $(TEST) $(TESTARGS) -timeout=10s
2015-01-30 07:03:25 -05:00
@$(MAKE) vet
2013-07-18 10:26:36 -04:00
2015-05-26 16:26:22 -04:00
# testacc runs acceptance tests
testacc: generate
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package"; \
exit 1; \
fi
PACKER_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m
testrace:
go test -race $(TEST) $(TESTARGS)
2013-03-24 17:47:59 -04:00
updatedeps:
@echo "Updating deps on:"; git symbolic-ref HEAD; git rev-parse HEAD
2015-06-15 16:50:01 -04:00
go get -u github.com/mitchellh/gox
go get -u golang.org/x/tools/cmd/stringer
go list ./... \
| xargs go list -f '{{join .Deps "\n"}}' \
| grep -v github.com/mitchellh/packer \
| grep -v '/internal/' \
2015-06-15 16:50:01 -04:00
| sort -u \
| xargs go get -f -u -v
@echo "Finished updating deps, now on:"; git symbolic-ref HEAD; git rev-parse HEAD
2013-03-24 17:31:18 -04:00
2015-01-30 07:03:25 -05:00
vet:
@echo "Running go vet on:"; git symbolic-ref HEAD; git rev-parse HEAD
@go vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
2015-01-30 07:03:25 -05:00
go get golang.org/x/tools/cmd/vet; \
fi
@go vet ./... ; if [ $$? -eq 1 ]; then \
2015-01-30 07:03:25 -05:00
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for reviewal."; \
exit 1; \
2015-01-30 07:03:25 -05:00
fi
2015-05-26 16:26:22 -04:00
.PHONY: bin default generate test testacc updatedeps vet