convox/Makefile
2019-08-21 12:41:07 -04:00

33 lines
690 B
Makefile

.PHONY: all build clean clean-package compress dev-aws package release test
commands = api atom build router
binaries = $(addprefix $(GOPATH)/bin/, $(commands))
sources = $(shell find . -name '*.go')
version := dev-$(shell date +%Y%m%d%H%M%S)
all: build
build: $(binaries)
clean: clean-package
clean-package:
find . -name '*-packr.go' -delete
compress: $(binaries)
upx-ucl -1 $^
package:
$(GOPATH)/bin/packr
release:
docker build -t convox/convox:$(version) .
docker push convox/convox:$(version)
test:
env PROVIDER=test go test -covermode atomic -coverprofile coverage.txt ./...
$(binaries): $(GOPATH)/bin/%: $(sources)
go install -mod=vendor --ldflags="-s -w" ./cmd/$*