8 Commits

Author SHA1 Message Date
JackWhh
91b8b9544d 1
Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com>
2024-07-19 03:30:48 +00:00
JackWhh
7335acf980 1
Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com>
2024-07-19 03:29:15 +00:00
JackWhh
c82544e20d 1
Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com>
2024-07-19 03:28:03 +00:00
JackWhh
397d4efe0e 1
Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com>
2024-07-19 03:07:00 +00:00
JackWhh
bcc301f18b 1
Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com>
2024-07-19 02:55:51 +00:00
JackWhh
06dc0da5d5 1
Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com>
2024-07-19 02:40:00 +00:00
JackWhh
16826b94db 1
Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com>
2024-07-18 09:30:05 +00:00
JackWhh
046196ef61 1
Signed-off-by: JackWhh <5264499+jack_whh@user.noreply.gitee.com>
2024-07-18 09:24:41 +00:00
2 changed files with 19 additions and 4 deletions

View File

@@ -36,7 +36,9 @@ inputs:
password:
description: "SSH passswordIf a password is set, the secret key pair is ignored"
required: false
script:
description: "upload files after exec script"
required: false
runs:
using: 'docker'
@@ -52,6 +54,7 @@ runs:
- ${{ inputs.sftpArgs }}
- ${{ inputs.delete_remote_files }}
- ${{ inputs.password }}
- ${{ inputs.script }}
branding:
icon: 'upload-cloud'

View File

@@ -1,4 +1,4 @@
#!/bin/sh -l
#!/bin/bash
#set -e at the top of your script will make the script exit with an error whenever an error occurs (and is not explicitly handled)
set -eu
@@ -41,8 +41,6 @@ fi
# keep string format
printf "%s" "$4" >$TEMP_SSH_PRIVATE_KEY_FILE
echo "-------"
cat $TEMP_SSH_PRIVATE_KEY_FILE
# avoid Permissions too open
chmod 600 $TEMP_SSH_PRIVATE_KEY_FILE
@@ -65,5 +63,19 @@ printf "%s" "put -r $5 $6" >$TEMP_SFTP_FILE
#-o StrictHostKeyChecking=no avoid Host key verification failed.
sftp -b $TEMP_SFTP_FILE -P $3 $8 -o StrictHostKeyChecking=no -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2
if [ -z != ${11} ]; then
echo $11
script=$11
echo $script
echo "------"
ssh -o StrictHostKeyChecking=no -p $3 -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 "$script"
echo "-----"
script1="./usr/local/transport-api/restart.sh restart"
echo $script
ssh -o StrictHostKeyChecking=no -p $3 -i $TEMP_SSH_PRIVATE_KEY_FILE $1@$2 "$script1"
echo "-----"
fi
echo 'Deploy Success'
exit 0