From f65adb7bd9c754dcc134e1dd1e3e4a84e9d5f8e7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 7 Sep 2020 17:53:30 +0100 Subject: [PATCH] wip deploy target Signed-off-by: Ian Jackson --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makefile b/Makefile index 416cc4b9..0d35d909 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,26 @@ templates/script.js: templates/script.ts tsconfig.json test "$${PIPESTATUS[*]}" = "0 0" mv -f $@.tmp $@ +DEPLOY_ARCH=x86_64-unknown-linux-musl +DEPLOY_RELEASE=debug +DEPLOY_TARGET_DIR=$(CARGO_TARGET_DIR)/$(addsuffix /,$(DEPLOY_ARCH))$(DEPLOY_RELEASE) + +deploy-build: $(DEPLOY_TARGET_DIR)/server +ifneq (,$(DEPLOY_ARCH)) +$(DEPLOY_TARGET_DIR)/server: + $(CARGO) -T$(DEPLOY_ARCH) build $(addprefix --,$(filter-out debug,$(DEPLOY_RELEASE))) + @echo Built $@. +.PHONY: $(DEPLOY_TARGET_DIR)/server +endif + +PROGRAMS=daemon-otter otter + +DEPLOY_BASE=Otter@login.chiark.greenend.org.uk:/volatile/Otter + +deploy: deploy-build bundled-sources + rsync -zv --progress $(addprefix $(DEPLOY_TARGET_DIR)/,$(PROGRAMS)) $(DEPLOY_BASE)/bin/ + rsync -rv --progress $(CARGO_TARGET_DIR)/bundled-sources/. $(DEPLOY_BASE)/bundled-sources + clean: rm -f templates/script.js rm -rf target -- 2.30.2