From 632447355921222dde22b611e204c550d44990fc Mon Sep 17 00:00:00 2001 From: dominic Date: Fri, 2 Mar 2018 17:42:19 +0800 Subject: [PATCH 1/6] no permission change after file transfer --- upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload.sh b/upload.sh index bf9a3eb..bc83d62 100755 --- a/upload.sh +++ b/upload.sh @@ -44,5 +44,5 @@ lftp -e "set xfer:log 1; \ set ftp:ssl-protect-data $PLUGIN_SECURE; \ set ssl:verify-certificate $PLUGIN_VERIFY; \ set ssl:check-hostname $PLUGIN_VERIFY; \ - mirror --verbose -R $PLUGIN_INCLUDE_STR $PLUGIN_EXCLUDE_STR $(pwd)$PLUGIN_SRC_DIR $PLUGIN_DEST_DIR" \ + mirror --verbose -p -R $PLUGIN_INCLUDE_STR $PLUGIN_EXCLUDE_STR $(pwd)$PLUGIN_SRC_DIR $PLUGIN_DEST_DIR" \ -u $FTP_USERNAME,$FTP_PASSWORD $PLUGIN_HOSTNAME From 12f35a574157525eb4fbc4a972129e0ee37b0b7b Mon Sep 17 00:00:00 2001 From: squaresun <5quar3sun@gmail.com> Date: Fri, 2 Mar 2018 18:05:40 +0800 Subject: [PATCH 2/6] add param PLUGIN_CHMOD --- upload.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/upload.sh b/upload.sh index bc83d62..62e3491 100755 --- a/upload.sh +++ b/upload.sh @@ -26,6 +26,12 @@ if [ -z "$PLUGIN_SRC_DIR" ]; then PLUGIN_SRC_DIR="/" fi +if [ -z "$PLUGIN_CHMOD" ]; then + PLUGIN_CHMOD="" +else + PLUGIN_CHMOD="-p" +fi + PLUGIN_EXCLUDE_STR="" PLUGIN_INCLUDE_STR="" @@ -44,5 +50,5 @@ lftp -e "set xfer:log 1; \ set ftp:ssl-protect-data $PLUGIN_SECURE; \ set ssl:verify-certificate $PLUGIN_VERIFY; \ set ssl:check-hostname $PLUGIN_VERIFY; \ - mirror --verbose -p -R $PLUGIN_INCLUDE_STR $PLUGIN_EXCLUDE_STR $(pwd)$PLUGIN_SRC_DIR $PLUGIN_DEST_DIR" \ + mirror --verbose $PLUGIN_CHMOD -R $PLUGIN_INCLUDE_STR $PLUGIN_EXCLUDE_STR $(pwd)$PLUGIN_SRC_DIR $PLUGIN_DEST_DIR" \ -u $FTP_USERNAME,$FTP_PASSWORD $PLUGIN_HOSTNAME From a037f0a362219b7a47c9f9cd7ad8b9332f5ebce5 Mon Sep 17 00:00:00 2001 From: squaresun <5quar3sun@gmail.com> Date: Fri, 2 Mar 2018 18:12:23 +0800 Subject: [PATCH 3/6] check PLUGIN_CHMOD if true --- upload.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upload.sh b/upload.sh index 62e3491..1e12824 100755 --- a/upload.sh +++ b/upload.sh @@ -29,7 +29,10 @@ fi if [ -z "$PLUGIN_CHMOD" ]; then PLUGIN_CHMOD="" else - PLUGIN_CHMOD="-p" + if [ "$PLUGIN_CHMOD" = true ]; then + PLUGIN_CHMOD="-p" + else + PLUGIN_CHMOD="" fi PLUGIN_EXCLUDE_STR="" From 50480b39a167f7da6f05c3de8706f96971fcb3c1 Mon Sep 17 00:00:00 2001 From: dominic Date: Fri, 2 Mar 2018 18:17:05 +0800 Subject: [PATCH 4/6] Fix bug --- upload.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/upload.sh b/upload.sh index 1e12824..862eb78 100755 --- a/upload.sh +++ b/upload.sh @@ -33,6 +33,7 @@ else PLUGIN_CHMOD="-p" else PLUGIN_CHMOD="" + fi fi PLUGIN_EXCLUDE_STR="" From 8dcca4fef9674b83cbe6ceec4cd00f5bfa6fb7fb Mon Sep 17 00:00:00 2001 From: squaresun <5quar3sun@gmail.com> Date: Fri, 2 Mar 2018 18:31:15 +0800 Subject: [PATCH 5/6] Fix PLUGIN_CHMOD checking --- upload.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload.sh b/upload.sh index 862eb78..8409aab 100755 --- a/upload.sh +++ b/upload.sh @@ -30,9 +30,9 @@ if [ -z "$PLUGIN_CHMOD" ]; then PLUGIN_CHMOD="" else if [ "$PLUGIN_CHMOD" = true ]; then - PLUGIN_CHMOD="-p" - else PLUGIN_CHMOD="" + else + PLUGIN_CHMOD="-p" fi fi From 668077a47b58e4f7e1624e1682ee12e45a668440 Mon Sep 17 00:00:00 2001 From: dominic Date: Fri, 2 Mar 2018 18:33:19 +0800 Subject: [PATCH 6/6] update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 084f657..8bcc8e3 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ pipeline: secrets: [ ftp_username, ftp_password ] secure: true (default) | false # true = use FTP(S), false = FTP without SSL verify: true (default) | false # true = strong SSL verification, false = supress SSL verification error + chmod: true (default) | false # true = chmod after file transferred, false = no chmod after file transferred dest_dir: /var/www/mysite src_dir: /mysite/static exclude: