mirror of
https://gitea.intern.drachenfels.de/ruben/goget.git
synced 2026-02-08 12:48:01 +00:00
add Dockerfile and build script
This commit is contained in:
25
Makefile
25
Makefile
@ -1,12 +1,17 @@
|
||||
BUILD_HASH := $(shell git describe --always --tags --long)
|
||||
LDFLAGS := "-X main.version=${BUILD_HASH} -s -w"
|
||||
COMMIT = $(shell git describe --always --tags --long --dirty)
|
||||
|
||||
RELEASE ?= $(COMMIT)
|
||||
LDFLAGS := -X main.version=$(RELEASE)
|
||||
|
||||
ifdef STATIC
|
||||
LDFLAGS += -w -s -extldflags=-static
|
||||
export CGO_ENABLED=0
|
||||
endif
|
||||
|
||||
all: fmt install
|
||||
|
||||
fmt:
|
||||
go fmt ./...
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
go fmt ./...
|
||||
go install -ldflags ${LDFLAGS} ./...
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
go fmt ./...
|
||||
go build -ldflags ${LDFLAGS} ./...
|
||||
go install -ldflags "${LDFLAGS}" ./...
|
||||
|
||||
Reference in New Issue
Block a user