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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-12-14 18:13:18 +0300
committerJacob Vosmaer <jacob@gitlab.com>2017-12-15 12:48:57 +0300
commit96d6831e8c73c315146b70bf488f2bcfd316a73c (patch)
tree7f9690ac6cb177430cffbf1bf3c9fe264e49cc77
parent6a68e7b5184031b61d8141e9568397e0543d9e15 (diff)
Add make task to cross-compile for linuxcustom-0.59.0
-rw-r--r--Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a50f44ca8..f48a2b4f9 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,8 @@ BUNDLE_FLAGS ?= --deployment
BUILDTIME = $(shell date -u +%Y%m%d.%H%M%S)
VERSION_PREFIXED = $(shell git describe)
VERSION = $(VERSION_PREFIXED:v%=%)
-GO_LDFLAGS = -ldflags '-X $(PKG)/internal/version.version=$(VERSION) -X $(PKG)/internal/version.buildtime=$(BUILDTIME)'
+GOVERSION = $(shell go version | awk '{print $$3}')
+GO_LDFLAGS = -ldflags '-X $(PKG)/internal/version.version=$(VERSION)-$(GOVERSION) -X $(PKG)/internal/version.buildtime=$(BUILDTIME)'
unexport GOROOT
unexport GOBIN
@@ -55,6 +56,17 @@ build: .ruby-bundle $(TARGET_SETUP)
go install $(GO_LDFLAGS) $(COMMAND_PACKAGES)
cp $(foreach cmd,$(COMMANDS),$(BIN_BUILD_DIR)/$(cmd)) $(BUILD_DIR)/
+# TODO make this less of a hack
+CUSTOM_NAME = gitaly-$(VERSION)-$(GOVERSION)
+CUSTOM_DIR = opt/$(CUSTOM_NAME)
+custom-linux-go-binary: $(TARGET_SETUP)
+ GOOS=linux GOARCH=amd64 go install $(GO_LDFLAGS) $(COMMAND_PACKAGES)
+ rm -rf _build/tmp
+ mkdir -p _build/tmp/$(CUSTOM_DIR)
+ cp $(BIN_BUILD_DIR)/linux_amd64/gitaly _build/tmp/$(CUSTOM_DIR)
+ tar -C _build/tmp -czf $(CUSTOM_NAME).tar.gz $(CUSTOM_DIR)
+ shasum -a256 *.tar.gz
+
.ruby-bundle: ruby/Gemfile.lock ruby/Gemfile
cd ruby && bundle install $(BUNDLE_FLAGS)
touch $@