latest
This commit is contained in:
23
Makefile
23
Makefile
@@ -3,28 +3,39 @@ BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
|
||||
BUILDUSER := $(shell whoami)
|
||||
BUILDHOST := $(shell hostname -s)
|
||||
BUILDARCH := $(shell uname -m)
|
||||
APPNAME := merp
|
||||
|
||||
GOLDFLAGS += -X main.Version=$(VERSION)
|
||||
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
|
||||
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
|
||||
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
|
||||
GOLDFLAGS += -X main.Appname=$(APPNAME)
|
||||
GOFLAGS = -ldflags "$(GOLDFLAGS)"
|
||||
|
||||
default: run
|
||||
|
||||
run: build
|
||||
DEBUG=1 ./pooteeweet
|
||||
DEBUG=1 ./$(APPNAME)
|
||||
|
||||
build: ./pooteeweet
|
||||
build: ./$(APPNAME)
|
||||
|
||||
./pooteeweet: *.go
|
||||
./$(APPNAME): *.go
|
||||
go build -o $@ $(GOFLAGS) .
|
||||
|
||||
clean:
|
||||
rm pooteeweet
|
||||
rm $(APPNAME)
|
||||
|
||||
fmt:
|
||||
go fmt *.go
|
||||
|
||||
test:
|
||||
docker build -t sneak/pooteeweet .
|
||||
test: build-image
|
||||
|
||||
build-and-push-image: push-image
|
||||
|
||||
push-image: build-image
|
||||
docker push sneak/$(APPNAME)
|
||||
|
||||
build-image:
|
||||
docker build \
|
||||
-t sneak/$(APPNAME):$(VERSION) \
|
||||
.
|
||||
|
||||
Reference in New Issue
Block a user