add deploy script
This commit is contained in:
parent
0cb7226a23
commit
0dbe76be57
14
deploy.sh
14
deploy.sh
|
@ -4,12 +4,18 @@ site=period3.xyz
|
|||
gemini=/home/gemini/gemini
|
||||
dest="$gemini/content"
|
||||
|
||||
sudo rm -r $dest/*
|
||||
sudo mv $site/* $dest
|
||||
# remove existing files
|
||||
sudo rm -rv $dest/*
|
||||
|
||||
rm -r $site
|
||||
# copy received files to hosting location
|
||||
sudo rsync -rvP $site/* $dest
|
||||
|
||||
printf "\n\tdone!\n\n"
|
||||
# clean up
|
||||
rm -rv $site
|
||||
# delete self
|
||||
rm deploy.sh
|
||||
|
||||
printf "\ndone!"
|
||||
|
||||
|
||||
|
||||
|
|
12
makefile
12
makefile
|
@ -1,4 +1,4 @@
|
|||
.DEFAULT_GOAL := site
|
||||
.DEFAULT_GOAL := $(SITE)
|
||||
|
||||
SITE = period3.xyz
|
||||
|
||||
|
@ -8,15 +8,17 @@ HOST_DIR = $(HOST):~
|
|||
CONTENT = content/
|
||||
DEPLOY = deploy.sh
|
||||
|
||||
site: $(SITE)
|
||||
|
||||
#
|
||||
$(SITE): $(CONTENT)
|
||||
[ -d $(SITE) ] || rsync -rP $(CONTENT) $(SITE)
|
||||
|
||||
deploy: 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)
|
||||
rsync -P $(DEPLOY) $(HOST_DIR)
|
||||
rsync -rP $(SITE) $(HOST_DIR)
|
||||
ssh $(HOST) "bash -s" < $(DEPLOY)
|
||||
|
||||
clean:
|
||||
clean: $(SITE)
|
||||
rm -r $(SITE)
|
||||
|
|
Loading…
Reference in New Issue