3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-15 00:19:29 +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:
Shivaram Lingamneni 2021-11-03 02:33:41 -04:00 committed by GitHub
commit 0f8f8b0de9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
## build ergo binary
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
WORKDIR /go/src/github.com/ergochat/ergo

View File

@ -1,16 +1,17 @@
.PHONY: all install build release capdefs test smoke gofmt irctest
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
all: 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:
go build -v -ldflags "-X main.commit=$(GIT_COMMIT)"
go build -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)"
release:
goreleaser --skip-publish --rm-dist