stop accidentally caching stuff locally when deploying"

This commit is contained in:
ktyl 2022-04-29 02:02:39 +01:00
parent 89a3b777f7
commit 400ace770f
2 changed files with 7 additions and 12 deletions

View File

@ -5,14 +5,12 @@ gemini=/home/gemini/gemini
dest="$gemini/content" dest="$gemini/content"
# remove existing files # remove existing files
sudo rm -rv $dest/* sudo rm -rv $dest
# copy received files to hosting location # copy received files to hosting location
sudo rsync -rvP $site/* $dest sudo mv $site $dest
sudo chown -R gemini:gemini $dest/* sudo chown -R gemini:gemini $dest
# clean up
rm -rv $site
# delete self # delete self
rm -v deploy.sh rm -v deploy.sh

View File

@ -8,17 +8,14 @@ HOST_DIR = $(HOST):~
CONTENT = content/ CONTENT = content/
DEPLOY = deploy.sh DEPLOY = deploy.sh
#
$(SITE): $(CONTENT)
[ -d $(SITE) ] || rsync -rP $(CONTENT) $(SITE)
# to deploy the site we copy a deploy script and the site # to deploy the site we copy a deploy script and the site
# contents over to the remote host, then run the deploy script # contents over to the remote host, then run the deploy script
# which is used to place the site files in the hosted root folder # 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 -P $(DEPLOY) $(HOST_DIR)
rsync -rP $(SITE) $(HOST_DIR) rsync -rP $(SITE) $(HOST_DIR)
ssh $(HOST) "bash -s" < $(DEPLOY) ssh $(HOST) "bash -s" < $(DEPLOY)
clean: $(SITE)
rm -r $(SITE) rm -r $(SITE)