From 23dffcd106fdf56b869692fa129e6eb003956ff1 Mon Sep 17 00:00:00 2001 From: Darren Worrall Date: Mon, 29 Jan 2024 11:14:30 +0000 Subject: [PATCH] WIP --- Makefile | 12 ++++++------ copydb/debian/control | 3 +-- sharding/debian/control | 3 +-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 29416f0d..a14ee9e2 100644 --- a/Makefile +++ b/Makefile @@ -26,15 +26,15 @@ BIN_DIR := usr/bin PROJECTS := copydb sharding PROJECT_DEBS := $(foreach name,$(PROJECTS),$(name)-deb) +PLATFORM := $(shell uname -s | tr A-Z a-z) +ARCH := $(shell uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g') +GOTESTSUM_URL := "https://github.com/gotestyourself/gotestsum/releases/download/v1.7.0/gotestsum_1.7.0_$(PLATFORM)_$(ARCH).tar.gz" + # Target specific variable, set proj to have a valid value. PROJECT_PKG = ./$(proj)/cmd PROJECT_BIN = ghostferry-$(proj) BIN_TARGET = $(GOBIN)/$(PROJECT_BIN) -DEB_TARGET = $(BUILD_DIR)/$(PROJECT_BIN)_$(VERSION_STR).deb - -PLATFORM := $(shell uname -s | tr A-Z a-z) -ARCH := $(shell uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g') -GOTESTSUM_URL := "https://github.com/gotestyourself/gotestsum/releases/download/v1.7.0/gotestsum_1.7.0_$(PLATFORM)_$(ARCH).tar.gz" +DEB_TARGET = $(BUILD_DIR)/$(PROJECT_BIN)_$(VERSION_STR)_$(ARCH).deb .PHONY: test test-go test-ruby clean reset-deb-dir $(PROJECTS) $(PROJECT_DEBS) .DEFAULT_GOAL := test @@ -46,7 +46,7 @@ $(PROJECTS): $(GOBIN) $(PROJECT_DEBS): LDFLAGS += -X github.com/Shopify/ghostferry.WebUiBasedir=/$(SHARE_DIR) $(PROJECT_DEBS): reset-deb-dir $(eval proj := $(subst -deb,,$@)) - sed -e "s/{version}/$(VERSION_STR)/" $(proj)/debian/control > $(DEB_PREFIX)/DEBIAN/control + sed -e "s/{version}/$(VERSION_STR)/" "s/{arch}/$(ARCH)/" $(proj)/debian/control > $(DEB_PREFIX)/DEBIAN/control cp $(proj)/debian/copyright $(DEB_PREFIX)/DEBIAN/copyright go build -ldflags "$(LDFLAGS)" -o $(DEB_PREFIX)/$(BIN_DIR)/$(PROJECT_BIN) $(PROJECT_PKG) cp -ar webui $(DEB_PREFIX)/$(SHARE_DIR) diff --git a/copydb/debian/control b/copydb/debian/control index 9182449e..300d9c1b 100644 --- a/copydb/debian/control +++ b/copydb/debian/control @@ -2,8 +2,7 @@ Package: ghostferry-copydb Version: {version}-1 Section: misc Priority: optional -Architecture: any -Multi-Arch: same +Architecture: {arch} Maintainer: Shuhao Wu Description: Migrate MySQL data from one server to another without downtime via ghostferry. diff --git a/sharding/debian/control b/sharding/debian/control index d22e341f..f37106e1 100644 --- a/sharding/debian/control +++ b/sharding/debian/control @@ -2,8 +2,7 @@ Package: ghostferry-sharding Version: {version} Section: misc Priority: optional -Architecture: any -Multi-Arch: same +Architecture: {arch} Maintainer: Shuhao Wu Uploaders: Justin Li ,Hormoz Kheradmand Description: Migrate MySQL sharded data from one server to