From 400ace770f27febd32d526e0d8c61e7c11c747e6 Mon Sep 17 00:00:00 2001 From: ktyl Date: Fri, 29 Apr 2022 02:02:39 +0100 Subject: [PATCH] stop accidentally caching stuff locally when deploying" --- deploy.sh | 8 +++----- makefile | 11 ++++------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/deploy.sh b/deploy.sh index dfae8bb..cfa980b 100644 --- a/deploy.sh +++ b/deploy.sh @@ -5,14 +5,12 @@ gemini=/home/gemini/gemini dest="$gemini/content" # remove existing files -sudo rm -rv $dest/* +sudo rm -rv $dest # copy received files to hosting location -sudo rsync -rvP $site/* $dest -sudo chown -R gemini:gemini $dest/* +sudo mv $site $dest +sudo chown -R gemini:gemini $dest -# clean up -rm -rv $site # delete self rm -v deploy.sh diff --git a/makefile b/makefile index 50b0899..150988f 100644 --- a/makefile +++ b/makefile @@ -8,17 +8,14 @@ HOST_DIR = $(HOST):~ CONTENT = content/ DEPLOY = deploy.sh -# -$(SITE): $(CONTENT) - [ -d $(SITE) ] || rsync -rP $(CONTENT) $(SITE) - # to deploy the site we copy a deploy script and the site # contents over to the remote host, then run the deploy script # which is used to place the site files in the hosted root folder -deploy: $(SITE) +# we then delete the built site directory locally to avoid accidentally +# caching stuff for future deploys +deploy: $(CONTENT) + rsync -rP $(CONTENT) $(SITE) rsync -P $(DEPLOY) $(HOST_DIR) rsync -rP $(SITE) $(HOST_DIR) ssh $(HOST) "bash -s" < $(DEPLOY) - -clean: $(SITE) rm -r $(SITE)