0
0
mirror of https://github.com/thegeeklab/wp-opentofu.git synced 2024-11-09 18:00:40 +00:00
wp-opentofu/Makefile

33 lines
691 B
Makefile
Raw Normal View History

2016-01-26 22:47:58 +00:00
.PHONY: clean deps fmt vet test docker
EXECUTABLE ?= drone-terraform
IMAGE ?= plugins/$(EXECUTABLE)
CI_BUILD_NUMBER ?= 0
2015-11-10 14:52:53 +00:00
2016-01-26 22:47:58 +00:00
LDFLAGS = -X "main.buildDate=$(shell date -u '+%Y-%m-%d %H:%M:%S %Z')"
PACKAGES = $(shell go list ./... | grep -v /vendor/)
2015-11-10 14:52:53 +00:00
clean:
2016-01-26 22:47:58 +00:00
go clean -i ./...
deps:
go get -t ./...
fmt:
go fmt $(PACKAGES)
vet:
go vet $(PACKAGES)
test:
@for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
docker:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-s -w $(LDFLAGS)'
docker build --rm -t $(IMAGE) .
$(EXECUTABLE): $(wildcard *.go)
go build -ldflags '-s -w $(LDFLAGS)'
build: $(EXECUTABLE)