Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #183 from jcvenegas/version-fix
Browse files Browse the repository at this point in the history
version: Dont use git describe to get version
  • Loading branch information
Samuel Ortiz committed Dec 13, 2017
2 parents 513b073 + 39c615d commit 8b46ac5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
24 changes: 7 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# This is the version string used when it isn't possible to do a git describe,
# which happens with a git-archive tarball for instance. A '+' is appended to
# the version string to mean that it's a development version eg. 3.0.0+ means
# somewhere between 3.0.0 and 3.0.1.
#
# The version should be bumped and the '+' sign removed just before tagging a
# new release.
# A '+' sign should be added in the commit just after tagging a new release.
VERSION := 3.0.10+

VERSION := ${shell cat ./VERSION}
DESTDIR :=
PREFIX := /usr
BINDIR=$(PREFIX)/bin
Expand All @@ -16,12 +7,11 @@ LOCALSTATEDIR := /var

SOURCES := $(shell find . 2>&1 | grep -E '.*\.(c|h|go)$$')
PROXY_SOCKET := $(LOCALSTATEDIR)/run/clear-containers/proxy.sock
COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true)
COMMIT := $(if $(shell git status --porcelain --untracked-files=no),${COMMIT_NO}-dirty,${COMMIT_NO})
VERSION_COMMIT := $(if $(COMMIT),$(VERSION)-$(COMMIT),$(VERSION))


DESCRIBE := $(shell git describe 2> /dev/null || true)
DESCRIBE_DIRTY := $(if $(shell git status --porcelain --untracked-files=no 2> /dev/null),${DESCRIBE}-dirty,${DESCRIBE})
ifneq ($(DESCRIBE_DIRTY),)
VERSION := $(DESCRIBE_DIRTY)
endif

#
# systemd files
Expand Down Expand Up @@ -51,9 +41,9 @@ all: cc-proxy $(UNIT_FILES)
# proxy
#

cc-proxy: $(SOURCES) Makefile
cc-proxy: $(SOURCES) Makefile VERSION
$(QUIET_GOBUILD)go build -i -o $@ -ldflags \
"-X main.DefaultSocketPath=$(PROXY_SOCKET) -X main.Version=$(VERSION)"
"-X main.DefaultSocketPath=$(PROXY_SOCKET) -X main.Version=$(VERSION_COMMIT)"

#
# Tests
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.10

0 comments on commit 8b46ac5

Please sign in to comment.