From 200890d01feb2fa26159cf18237f9a4f23286a59 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 8 Sep 2017 13:05:08 +0200 Subject: Deploy script source directory defined as parameter --- Makefile | 2 +- bin/deploy.sh | 5 +++-- docs/scripts.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a5ec358..93a6e49 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ $(tmpfiles): deploy: find http -type f -name .menu.html -delete - bin/deploy.sh + bin/deploy.sh http clean: find http -type f -name \*.html -delete diff --git a/bin/deploy.sh b/bin/deploy.sh index ec0d4ec..4a5d451 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -1,8 +1,9 @@ #!/bin/bash +LOCALPATH=$1 DEPLOYPATH=`cat config/deploy-path` if [ -s config/deploy-pass ] then - sshpass -f config/deploy-pass rsync -urpP --delete http/ $DEPLOYPATH + sshpass -f config/deploy-pass rsync -urpP --delete $LOCALPATH/ $DEPLOYPATH else - rsync -urpP --delete http/ $DEPLOYPATH + rsync -urpP --delete $LOCALPATH/ $DEPLOYPATH fi diff --git a/docs/scripts.md b/docs/scripts.md index 8c5ad05..d715671 100644 --- a/docs/scripts.md +++ b/docs/scripts.md @@ -100,4 +100,4 @@ Deployment scripts `deploy.sh` -Just run it to sync pages output directory with a remote location, via `rsync`. If `config/deploy-pass` is present, it's provided to rsync via `sshpass`. `config/deploy-path` defines remote path for sync. +Just run it to sync pages output directory (script's parameter) with a remote location, via `rsync`. If `config/deploy-pass` is present, it's provided to rsync via `sshpass`. `config/deploy-path` defines remote path for sync. -- cgit v1.2.3