012ae52fc7
just some basic docker make file stuff to make it easier for local dev. Co-authored-by: gedw99 <gedw99@gmail.com> Reviewed-on: https://git.mills.io/prologic/tube/pulls/17 Co-authored-by: gerard webb <gedw99@noreply@mills.io> Co-committed-by: gerard webb <gedw99@noreply@mills.io>
38 lines
701 B
Makefile
38 lines
701 B
Makefile
.PHONY: dev setup build install image test release clean
|
|
|
|
CGO_ENABLED=0
|
|
VERSION=$(shell git describe --abbrev=0 --tags)
|
|
COMMIT=$(shell git rev-parse --short HEAD)
|
|
|
|
all: dev
|
|
|
|
dev: build
|
|
@./tube -v
|
|
|
|
setup:
|
|
@go get github.com/GeertJohan/go.rice/rice
|
|
|
|
build: clean
|
|
@command -v rice > /dev/null || make setup
|
|
@go generate $(shell go list)/...
|
|
@go build \
|
|
-tags "netgo static_build" -installsuffix netgo \
|
|
-ldflags "-w -X main.Version=$(VERSION) -X main.Commit=$(COMMIT)" \
|
|
.
|
|
|
|
install: build
|
|
@go install
|
|
|
|
docker-image:
|
|
@docker build -t prologic/tube .
|
|
docker-run:
|
|
@docker run -p 8000:8000 -t prologic/tube .
|
|
|
|
test: install
|
|
@go test
|
|
|
|
release:
|
|
@./tools/release.sh
|
|
|
|
clean:
|
|
@git clean -f -d -X
|