2020-03-30 11:23:18 +03:00
|
|
|
.PHONY: dev setup build install image test release clean
|
2020-03-21 01:20:16 +03:00
|
|
|
|
|
|
|
CGO_ENABLED=0
|
|
|
|
VERSION=$(shell git describe --abbrev=0 --tags)
|
|
|
|
COMMIT=$(shell git rev-parse --short HEAD)
|
|
|
|
|
|
|
|
all: dev
|
|
|
|
|
|
|
|
dev: build
|
2020-03-21 01:31:24 +03:00
|
|
|
@./tube -v
|
2020-03-21 01:20:16 +03:00
|
|
|
|
2020-03-21 02:55:06 +03:00
|
|
|
setup:
|
|
|
|
@go get github.com/GeertJohan/go.rice/rice
|
|
|
|
|
2020-03-21 01:20:16 +03:00
|
|
|
build: clean
|
2020-03-21 04:03:00 +03:00
|
|
|
@command -v rice > /dev/null || make setup
|
2020-03-21 02:55:06 +03:00
|
|
|
@go generate $(shell go list)/...
|
|
|
|
@go build \
|
2020-03-21 01:20:16 +03:00
|
|
|
-tags "netgo static_build" -installsuffix netgo \
|
|
|
|
-ldflags "-w -X $(shell go list).Version=$(VERSION) -X $(shell go list).Commit=$(COMMIT)" \
|
|
|
|
.
|
|
|
|
|
|
|
|
install: build
|
|
|
|
@go install
|
|
|
|
|
2020-03-30 11:23:18 +03:00
|
|
|
image:
|
|
|
|
@docker build -t prologic/tube .
|
|
|
|
|
2020-03-21 01:20:16 +03:00
|
|
|
test: install
|
|
|
|
@go test
|
|
|
|
|
|
|
|
release:
|
|
|
|
@./tools/release.sh
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@git clean -f -d -X
|