Make ssh and cli execution possible with parameters
This commit is contained in:
parent
aa3382675c
commit
ac4f568feb
@ -5,7 +5,6 @@ exec 100> $HOME/homepage.lock
|
||||
flock 100
|
||||
|
||||
log=$(mktemp)
|
||||
exec 11>&1 12>&2 > "$log" 2>&1
|
||||
|
||||
catch_err () {
|
||||
(
|
||||
@ -26,11 +25,17 @@ src=/srv/data/tsc-cloud/homepage/hugo-page
|
||||
dst=/srv/http/tsc/hugo
|
||||
prod=/srv/data/tsc-cloud/homepage/production
|
||||
|
||||
cmd="$SSH_ORIGINAL_COMMAND"
|
||||
if [ -n "$SSH_ORIGINAL_COMMAND" ]
|
||||
then
|
||||
cmd="$SSH_ORIGINAL_COMMAND"
|
||||
else
|
||||
cmd="$@"
|
||||
fi
|
||||
# echo "$cmd"
|
||||
|
||||
publishToStage=
|
||||
publishToProduction=y
|
||||
verboseLogs=n
|
||||
|
||||
branch=develop
|
||||
|
||||
@ -52,6 +57,9 @@ parseCMD() {
|
||||
--debug)
|
||||
set -x
|
||||
;;
|
||||
--verbose|-v)
|
||||
verboseLogs=y
|
||||
;;
|
||||
*)
|
||||
echo "Unknown command $part"
|
||||
exit 1
|
||||
@ -61,6 +69,11 @@ parseCMD() {
|
||||
}
|
||||
parseCMD $cmd
|
||||
|
||||
if [ "$verboseLogs" = "n" ]
|
||||
then
|
||||
exec 11>&1 12>&2 > "$log" 2>&1
|
||||
fi
|
||||
|
||||
doPublishToStage() {
|
||||
rsync -ah --delete --delete-delay public/ "$dst/"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user