diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-12-14 18:13:18 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-12-14 18:13:18 +0300 |
commit | 121f0dd605b5be31df310bf76615299b4e86372c (patch) | |
tree | c55e4aecc95202f576d36b86a121472207ad9f7a | |
parent | 217f449ae1e017636423d9b5be5560e5ed068753 (diff) |
Add make task to cross-compile for linuxcustom-0.52.1
-rw-r--r-- | Makefile | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 |