stop accidentally caching stuff locally when deploying"
This commit is contained in:
parent
89a3b777f7
commit
400ace770f
|
@ -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
|
||||
|
||||
|
|
11
makefile
11
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)
|
||||
|
|
Loading…
Reference in New Issue