improve deploy script
This commit is contained in:
parent
33337cf2ed
commit
fb75a9b4de
|
@ -0,0 +1,2 @@
|
|||
# build artifact
|
||||
period3.xyz
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
site=period3.xyz
|
||||
gemini=/home/gemini/gemini
|
||||
dest="$gemini/content"
|
||||
|
||||
sudo rm -r $dest/*
|
||||
sudo mv $site/* $dest
|
||||
|
||||
rm -r $site
|
||||
|
||||
printf "\n\tdone!\n\n"
|
||||
|
||||
|
||||
|
24
makefile
24
makefile
|
@ -1,6 +1,22 @@
|
|||
HOST = pluto
|
||||
.DEFAULT_GOAL := site
|
||||
|
||||
SITE = period3.xyz
|
||||
|
||||
deploy:
|
||||
git push
|
||||
ssh $(HOST) ./deploy-$(SITE)
|
||||
HOST = pluto
|
||||
HOST_DIR = $(HOST):~
|
||||
|
||||
CONTENT = content/
|
||||
DEPLOY = deploy.sh
|
||||
|
||||
site: $(SITE)
|
||||
|
||||
$(SITE): $(CONTENT)
|
||||
[ -d $(SITE) ] || rsync -rP $(CONTENT) $(SITE)
|
||||
|
||||
deploy: site
|
||||
rsync -P $(DEPLOY) $(HOST_DIR)
|
||||
rsync -rP $(SITE) $(HOST_DIR)
|
||||
ssh $(HOST) "bash -s" < $(DEPLOY)
|
||||
|
||||
clean:
|
||||
rm -r $(SITE)
|
||||
|
|
Loading…
Reference in New Issue