From 7fd32bff94b68c7814f9d09a62c7c26f950c895c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Fri, 3 Jul 2020 11:17:29 +0200 Subject: [PATCH 1/3] make directory when needed --- entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index e9290fe..32dfde2 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,6 +14,8 @@ chmod 600 $TEMP_SSH_PRIVATE_KEY_FILE echo 'sftp start' +# create directory if needed +ssh -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 mkdir -p $5 # create a temporary file containing sftp commands printf "%s" "put -r $5 $6" >$TEMP_SFTP_FILE #-o StrictHostKeyChecking=no avoid Host key verification failed. From 564673d5952023f504494334fa0c86d020868dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Fri, 3 Jul 2020 11:28:33 +0200 Subject: [PATCH 2/3] disable StrictHostKeyChecking --- entrypoint.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 32dfde2..ae14b0d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,10 +12,11 @@ printf "%s" "$4" >$TEMP_SSH_PRIVATE_KEY_FILE # avoid Permissions too open chmod 600 $TEMP_SSH_PRIVATE_KEY_FILE -echo 'sftp start' - +echo 'ssh start' # create directory if needed -ssh -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 mkdir -p $5 +ssh -o StrictHostKeyChecking=no -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 mkdir -p $5 + +echo 'sftp start' # create a temporary file containing sftp commands printf "%s" "put -r $5 $6" >$TEMP_SFTP_FILE #-o StrictHostKeyChecking=no avoid Host key verification failed. From 1f1ab26f781a91e1882cc903cbd0984d712729a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Fri, 3 Jul 2020 11:35:24 +0200 Subject: [PATCH 3/3] remove "make sure dir exists" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f552dc7..7b2888d 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ args of sftp cmd, E.g.`-o ConnectTimeout=5` server: 'your server ip' private_key: ${{ secrets.SSH_PRIVATE_KEY }} local_path: './static/*' - remote_path: '/var/www/app' #make sure dir exist + remote_path: '/var/www/app' args: '-o ConnectTimeout=5' ## 1. [Deploy React App Example](https://github.com/wlixcc/React-Deploy) @@ -129,4 +129,4 @@ args of sftp cmd, E.g.`-o ConnectTimeout=5` - \ No newline at end of file +