This commit is contained in:
2019-10-03 12:30:04 -07:00
commit 282e902b0a
4 changed files with 115 additions and 0 deletions

27
Makefile Normal file
View File

@@ -0,0 +1,27 @@
VERSION := $(shell git rev-parse --short HEAD)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
BUILDUSER := $(shell whoami)
BUILDHOST := $(shell hostname -s)
BUILDARCH := $(shell uname -m)
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
GOFLAGS = -ldflags "$(GOLDFLAGS)"
default: run
run: build
./pooteeweet
build: ./pooteeweet
./pooteeweet: *.go
go build -o $@ $(GOFLAGS) .
fmt:
go fmt *.go
test:
docker build -t sneak/pooteeweet .