From 0986c64a80e5098f66a13554c24c2a6053b5b6bf Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 8 Aug 2021 16:58:18 +0200 Subject: [PATCH] fixup! build: makefile: add deploy step --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0dd8524..f123d87 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,12 @@ serve: hugo server -D -F deploy: - @if [ -n "$$KEY" ]; then eval "$$(ssh-agent)"; echo "$$KEY" | ssh-add -; fi - if [ -z "$$USERNAME" ] || [ -z "$$SSH_HOST" ] || [ -z "$$TARGET" ]; then exit 1; fi - rsync --progress -avz --delete public/ "$$USERNAME@$$SSH_HOST:$$TARGET" + @if [ -n "$$SSH_KEY" ]; then eval "$$(ssh-agent)"; echo "$$SSH_KEY" | ssh-add -; fi + @if [ -z "$$SSH_USER" ] || [ -z "$$SSH_HOST" ] || [ -z "$$SSH_TARGET" ]; \ + then echo "Missing one of SSH_USER, SSH_HOST, or TARGET" >&2; \ + exit 1; \ + fi + rsync --progress -avz --delete public/ "$$SSH_USER@$$SSH_HOST:$$TARGET" .PHONY: clean clean: