Adds the alternative of the sftp command for SSH

Some managed web hosts (e.g. gandi.net) do not allow uploads with scp or rsync, so the sftp command is a necessary alternative.
This commit is contained in:
disk0x 2020-08-18 20:22:42 +02:00 committed by GitHub
commit b4fad44f1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,6 +70,7 @@ help:
@echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
@echo ' make devserver [PORT=8000] serve and regenerate together '
@echo ' make ssh_upload upload the web site via SSH '
@echo ' make sftp_upload upload the web site via sftp '
@echo ' make rsync_upload upload the web site via rsync+ssh '
{% if dropbox %}
@echo ' make dropbox_upload upload the web site via Dropbox '
@ -121,6 +122,9 @@ publish:
ssh_upload: publish
scp -P $(SSH_PORT) -r "$(OUTPUTDIR)"/* "$(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)"
sftp_upload: publish
printf 'put -r $(OUTPUTDIR)/*' | sftp $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
{% set upload = upload + ["rsync_upload"] %}
rsync_upload: publish
rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --include tags --cvs-exclude --delete "$(OUTPUTDIR)"/ "$(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)"