Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-02-09 13:49:53 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-09 13:49:53 +0300
commit78de2cf5af7ba799590ec2c02c80276818d1aa36 (patch)
tree8b5a7cd3bbf183aec7f77b9ff94f61f3ce75624c /Makefile
parentc45603a62842da51f241b61d25c4d4947d7a2652 (diff)
Add Makefile with version
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..e356ef5c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+REVISION := $(shell git rev-parse --short HEAD || echo unknown)
+LAST_TAG := $(shell git describe --tags --abbrev=0)
+COMMITS := $(shell echo `git log --oneline $(LAST_TAG)..HEAD | wc -l`)
+VERSION := $(shell cat VERSION)
+
+ifneq ($(VERSION),$(LAST_TAG))
+ VERSION := $(shell echo $(VERSION)~beta.$(COMMITS).g$(REVISION))
+endif
+
+GO_LDFLAGS ?= -X main.VERSION=$(VERSION) -X main.REVISION=$(REVISION)
+GO_FILES ?= $(shell find . -name '*.go')
+
+export GO15VENDOREXPERIMENT := 1
+
+all: gitlab-pages
+
+gitlab-pages: $(GO_FILES)
+ go build -o gitlab-pages --ldflags="$(GO_LDFLAGS)"
+
+update:
+ godep save ./...