From a9ee4acddce17e0b0abf1672f43477ef8fa76117 Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Wed, 5 Oct 2022 16:02:54 +0200 Subject: [PATCH] add pre- and post-local --- Makefile | 10 +++++++++- copy.mk | 7 +++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3620908..539d0f0 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ include secrets.mk self-update: @- git submodule update --remote -deploy: upload pre-deploy pull start post-deploy +deploy: upload pre-deploy pre-local pull start post-local post-deploy pre-deploy: @- echo "\n### running pre-deploy script" @@ -25,6 +25,14 @@ post-deploy: ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh post-deploy.sh"; \ ) +pre-local: + @- echo "\n### running pre-local script" + @- sh ./pre-local.sh + +post-local: + @- echo "\n### running pre-local script" + @- sh ./post-local.sh + upload: @- echo "\n### uploading files" @- $(foreach host,$(DEPLOY_HOSTS), \ diff --git a/copy.mk b/copy.mk index fb1234f..415f123 100644 --- a/copy.mk +++ b/copy.mk @@ -1,10 +1,13 @@ # copy # # this just rsyncs the stuff to the remote server(s) and runs -# pre- and post-deploy +# pre-/post-deploy and pre-/post-local pull-copy: # nop start-copy: - # nop + @- echo "\n### start" + @- $(foreach host,$(DEPLOY_HOSTS), \ + ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh start.sh"; \ + )