From 12afc5571707b75ce12ec686839e59a418a73b1a Mon Sep 17 00:00:00 2001 From: Thijs Niks Date: Thu, 14 Nov 2019 16:21:14 -0800 Subject: [PATCH 1/7] Excluding Git history MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comparing all Git files on every action takes up time and I’m assuming people don’t need the Git history to be available on their FTP server --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f1b60df..da1e7c8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,4 +2,4 @@ set -e -lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" From e46bbab164114d33a63ff65575348555877410aa Mon Sep 17 00:00:00 2001 From: Thijs Niks Date: Thu, 14 Nov 2019 20:49:02 -0800 Subject: [PATCH 2/7] Made the server variable a secret --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d7082a..8c9893f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ jobs: - name: Deploy FTP uses: sebastianpopp/ftp-action@master with: - host: "ftp.example.com" + host: ${{ secrets.FTP_SERVER }} user: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} localDir: "dist" From 0dcdfc242f3bae5870c85d6a1900cc61d4eed81a Mon Sep 17 00:00:00 2001 From: Thijs Niks Date: Thu, 14 Nov 2019 20:52:08 -0800 Subject: [PATCH 3/7] Continue when possible --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index da1e7c8..747d03d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,4 +2,4 @@ set -e -lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R -c -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" From 890fde3763772029ac24c5bba11f62db73be83ef Mon Sep 17 00:00:00 2001 From: Thijs Niks Date: Thu, 14 Nov 2019 20:52:48 -0800 Subject: [PATCH 4/7] Deference symbolic links --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 747d03d..2924dff 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,4 +2,4 @@ set -e -lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R -c -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R -c -L -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" From 49423c546342486d9c6d77d10a33fdece3e6e9bc Mon Sep 17 00:00:00 2001 From: Thijs Niks Date: Thu, 14 Nov 2019 20:54:10 -0800 Subject: [PATCH 5/7] Verbose bash commands --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2924dff..7c1b429 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,4 +2,4 @@ set -e -lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R -c -L -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" From 098896f8aefc816428a266aedef64adff8579c71 Mon Sep 17 00:00:00 2001 From: Thijs Niks Date: Thu, 14 Nov 2019 21:05:33 -0800 Subject: [PATCH 6/7] Added bash feedback --- entrypoint.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7c1b429..7993fc6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,13 @@ #!/bin/sh -set -e +set -eu + +echo "Starting FTP Deploy" + +echo "Using $INPUT_USER to connect to $INPUT_HOST" + +echo "Mirroring from $INPUT_LOCALDIR to $INPUT_REMOTEDIR" lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" + +echo "FTP Deploy Complete" \ No newline at end of file From 5b5c1425a21a17370d6cbcb947c2736b4f911cf9 Mon Sep 17 00:00:00 2001 From: Thijs Niks Date: Fri, 15 Nov 2019 17:48:52 -0800 Subject: [PATCH 7/7] Revert "Added bash feedback" This reverts commit 098896f8aefc816428a266aedef64adff8579c71. --- entrypoint.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7993fc6..7c1b429 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,13 +1,5 @@ #!/bin/sh -set -eu - -echo "Starting FTP Deploy" - -echo "Using $INPUT_USER to connect to $INPUT_HOST" - -echo "Mirroring from $INPUT_LOCALDIR to $INPUT_REMOTEDIR" +set -e lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" - -echo "FTP Deploy Complete" \ No newline at end of file