Add deploy script

This commit is contained in:
Timothée Floure 2021-01-04 07:58:18 +01:00
parent 26a57aeff1
commit 9c2bd43c8f
Signed by: tfloure
GPG key ID: 4502C902C00A1E12
3 changed files with 11 additions and 7 deletions

View file

@ -8,23 +8,18 @@ BASE_TITLE = Recycled Cloud
PAGES = index.html services.html manifesto.html contact.html PAGES = index.html services.html manifesto.html contact.html
BLOBS = assets/ BLOBS = assets/
# Default target.
all: $(PAGES) all: $(PAGES)
clean: clean:
rm -rf $(PAGES) rm -rf $(PAGES)
# If you built it, flaunt it!
deploy: $(PAGES) $(BLOBS) deploy: $(PAGES) $(BLOBS)
./deploy.sh $^ ./deploy.sh $^
.part.html: .part.html:
./page-template.sh $+ > $@ ./page-template.sh $+ > $@
# Setup some common dependencies so updating targets work.
$(PAGES): page-template.sh assets $(PAGES): page-template.sh assets
# Modify variables ?
index.html: TITLE = "$(BASE_TITLE) | Home" index.html: TITLE = "$(BASE_TITLE) | Home"
services.html: TITLE = "$(BASE_TITLE) | Services" services.html: TITLE = "$(BASE_TITLE) | Services"
manifesto.html: TITLE = "$(BASE_TITLE) | Manifesto" manifesto.html: TITLE = "$(BASE_TITLE) | Manifesto"

9
deploy.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
DESTINATION=root@static.recycled.cloud:/var/www/
WEBSITE=static.staging.recycled.cloud
sftp -b - "$DESTINATION" <<- EOF
-rm $WEBSITE/*
$(for f in "$@"; do echo "put -R $f $WEBSITE/"; done)
EOF