From 55fedb1ed464a4252ceab534fb3dccb95607a1e9 Mon Sep 17 00:00:00 2001 From: Tim Bernhard Date: Sun, 12 Apr 2020 21:04:18 +0200 Subject: [PATCH] Fix issue where the local dir was copied too --- Dockerfile | 2 +- entrypoint.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b1e438..f46edf6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.11 COPY LICENSE README.md / -RUN apk --no-cache add lftp +# RUN apk --no-cache add lftp RUN apk --no-cache add ncftp COPY entrypoint.sh /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 2e561b8..8c824c4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,8 @@ #!/bin/sh -l - - # lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; mirror --reverse --continue --dereference --verbose=3 -P -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" -ncftpput -R -z -u "$INPUT_USER" -p "$INPUT_PASSWORD" "$INPUT_HOST" "$INPUT_REMOTEDIR" "$INPUT_LOCALDIR" +# switch directory instead of using ncftp "local_dir" parameter +# this way, the local_dir is not created too. +cd "$INPUT_LOCALDIR" || exit 2; +ncftpput -R -z -m -u "$INPUT_USER" -p "$INPUT_PASSWORD" "$INPUT_HOST" "$INPUT_REMOTEDIR" "."