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-14 18:13:18 +0300
commit121f0dd605b5be31df310bf76615299b4e86372c (patch)
treec55e4aecc95202f576d36b86a121472207ad9f7a
parent217f449ae1e017636423d9b5be5560e5ed068753 (diff)
Add make task to cross-compile for linuxcustom-0.52.1
-rw-r--r--Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f32cd684f..7d224948e 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,8 @@ export GITALY_TEST_RUBY_DIR := $(BUILD_DIR)/ruby
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
@@ -54,6 +55,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
if test -z "${BUNDLE_PATH}" ; then cd ruby && bundle config --local path vendor/bundle; fi
cd ruby && bundle install