fix: log buffer from rsync stdout

This commit is contained in:
Dragan Filipovic 2023-01-02 22:30:57 +01:00
parent da62405174
commit 8e19e0d6bc
3 changed files with 12 additions and 8 deletions

View File

@ -8,7 +8,7 @@ on:
ARGS: ARGS:
description: 'ARGS' description: 'ARGS'
required: true required: true
default: '-rltgoDzvO --delete --chmod=ugo=rwX' default: '-rltgoDzvO --delete --chmod=ugo=rwX --progress'
EXCLUDE: EXCLUDE:
description: 'EXCLUDE' description: 'EXCLUDE'
required: true required: true
@ -16,7 +16,7 @@ on:
SSH_CMD_ARGS: SSH_CMD_ARGS:
description: 'SSH_CMD_ARGS' description: 'SSH_CMD_ARGS'
required: true required: true
default: '-o StrictHostKeyChecking=no, -o AnotherArg=7' default: '-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null'
env: env:
@ -66,6 +66,9 @@ jobs:
mkdir test_project mkdir test_project
cd test_project cd test_project
touch index.html touch index.html
touch image.svg
touch text.txt
truncate -s 500MB big_file.txt
date +"%Y-%m-%d %H:%M:%S,%3N" >> index.html date +"%Y-%m-%d %H:%M:%S,%3N" >> index.html
cat index.html cat index.html
@ -76,8 +79,8 @@ jobs:
# SSH_PRIVATE_KEY: $EXAMPLE_SSH_PRIVATE_KEY # SSH_PRIVATE_KEY: $EXAMPLE_SSH_PRIVATE_KEY
# REMOTE_HOST: $EXAMPLE_REMOTE_HOST # REMOTE_HOST: $EXAMPLE_REMOTE_HOST
REMOTE_USER: ${{ env.TEST_USER }} REMOTE_USER: ${{ env.TEST_USER }}
ARGS: ${{ github.event.inputs.ARGS || '-rltgoDzvO --delete --chmod=ugo=rwX' }} ARGS: ${{ github.event.inputs.ARGS || '-rltgoDzvO --delete --chmod=ugo=rwX --progress' }}
SSH_CMD_ARGS: ${{ github.event.inputs.SSH_CMD_ARGS || '-o StrictHostKeyChecking=no, -o AnotherArg=7' }} SSH_CMD_ARGS: ${{ github.event.inputs.SSH_CMD_ARGS || '-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null' }}
SOURCE: "test_project/" SOURCE: "test_project/"
TARGET: "/var/www/html/" TARGET: "/var/www/html/"
EXCLUDE: ${{ github.event.inputs.EXCLUDE || '/dist/, /node_modules/' }} EXCLUDE: ${{ github.event.inputs.EXCLUDE || '/dist/, /node_modules/' }}

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -51,7 +51,9 @@ const rsyncCli = async ({
const defaultOptions = { const defaultOptions = {
ssh: true, ssh: true,
recursive: true recursive: true,
onStdout: (data) => console.log(data.toString()),
onStderr: (data) => console.error(data.toString())
}; };
// RSYNC COMMAND // RSYNC COMMAND
@ -59,8 +61,7 @@ const rsyncCli = async ({
return nodeRsyncPromise({ return nodeRsyncPromise({
...defaultOptions, ...defaultOptions,
src: source, dest: rsyncServer, excludeFirst: exclude, port: remotePort, src: source, dest: rsyncServer, excludeFirst: exclude, port: remotePort,
privateKey: privateKeyPath, args, sshCmdArgs, privateKey: privateKeyPath, args, sshCmdArgs
onStdout: (data) => console.log(data), onStderr: (data) => console.error(data)
}); });
}; };