mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-15 08:29:31 +01:00
Merge pull request #1815 from slingamn/githash
fix some inconsistencies in how git hashes and tags are included in the binary
This commit is contained in:
commit
0f8f8b0de9
@ -1,7 +1,7 @@
|
|||||||
## build ergo binary
|
## build ergo binary
|
||||||
FROM golang:1.17-alpine3.13 AS build-env
|
FROM golang:1.17-alpine3.13 AS build-env
|
||||||
|
|
||||||
RUN apk add -U --force-refresh --no-cache --purge --clean-protected -l -u make
|
RUN apk add -U --force-refresh --no-cache --purge --clean-protected -l -u make git
|
||||||
|
|
||||||
# copy ergo source
|
# copy ergo source
|
||||||
WORKDIR /go/src/github.com/ergochat/ergo
|
WORKDIR /go/src/github.com/ergochat/ergo
|
||||||
|
5
Makefile
5
Makefile
@ -1,16 +1,17 @@
|
|||||||
.PHONY: all install build release capdefs test smoke gofmt irctest
|
.PHONY: all install build release capdefs test smoke gofmt irctest
|
||||||
|
|
||||||
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null)
|
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null)
|
||||||
|
GIT_TAG := $(shell git tag --points-at HEAD 2> /dev/null | head -n 1)
|
||||||
|
|
||||||
capdef_file = ./irc/caps/defs.go
|
capdef_file = ./irc/caps/defs.go
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install -v -ldflags "-X main.commit=$(GIT_COMMIT)"
|
go install -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -v -ldflags "-X main.commit=$(GIT_COMMIT)"
|
go build -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)"
|
||||||
|
|
||||||
release:
|
release:
|
||||||
goreleaser --skip-publish --rm-dist
|
goreleaser --skip-publish --rm-dist
|
||||||
|
Loading…
Reference in New Issue
Block a user