Merge pull request #8 from squaresun/master

Fix chmod error message after file transferred
This commit is contained in:
Christoph Schlosser 2018-03-02 13:55:30 +01:00 committed by GitHub
commit 25eb330321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -46,6 +46,7 @@ pipeline:
secrets: [ ftp_username, ftp_password ] secrets: [ ftp_username, ftp_password ]
secure: true (default) | false # true = use FTP(S), false = FTP without SSL 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 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 dest_dir: /var/www/mysite
src_dir: /mysite/static src_dir: /mysite/static
exclude: exclude:

View File

@ -26,6 +26,16 @@ if [ -z "$PLUGIN_SRC_DIR" ]; then
PLUGIN_SRC_DIR="/" PLUGIN_SRC_DIR="/"
fi fi
if [ -z "$PLUGIN_CHMOD" ]; then
PLUGIN_CHMOD=""
else
if [ "$PLUGIN_CHMOD" = true ]; then
PLUGIN_CHMOD=""
else
PLUGIN_CHMOD="-p"
fi
fi
PLUGIN_EXCLUDE_STR="" PLUGIN_EXCLUDE_STR=""
PLUGIN_INCLUDE_STR="" PLUGIN_INCLUDE_STR=""
@ -44,5 +54,5 @@ lftp -e "set xfer:log 1; \
set ftp:ssl-protect-data $PLUGIN_SECURE; \ set ftp:ssl-protect-data $PLUGIN_SECURE; \
set ssl:verify-certificate $PLUGIN_VERIFY; \ set ssl:verify-certificate $PLUGIN_VERIFY; \
set ssl:check-hostname $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 $PLUGIN_CHMOD -R $PLUGIN_INCLUDE_STR $PLUGIN_EXCLUDE_STR $(pwd)$PLUGIN_SRC_DIR $PLUGIN_DEST_DIR" \
-u $FTP_USERNAME,$FTP_PASSWORD $PLUGIN_HOSTNAME -u $FTP_USERNAME,$FTP_PASSWORD $PLUGIN_HOSTNAME