Skip to content

Commit 8e19e0d

Browse files
committedJan 2, 2023
fix: log buffer from rsync stdout
1 parent da62405 commit 8e19e0d

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed
 

‎.github/workflows/e2e.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88
ARGS:
99
description: 'ARGS'
1010
required: true
11-
default: '-rltgoDzvO --delete --chmod=ugo=rwX'
11+
default: '-rltgoDzvO --delete --chmod=ugo=rwX --progress'
1212
EXCLUDE:
1313
description: 'EXCLUDE'
1414
required: true
1515
default: '/dist/, /node_modules/'
1616
SSH_CMD_ARGS:
1717
description: 'SSH_CMD_ARGS'
1818
required: true
19-
default: '-o StrictHostKeyChecking=no, -o AnotherArg=7'
19+
default: '-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null'
2020

2121

2222
env:
@@ -66,6 +66,9 @@ jobs:
6666
mkdir test_project
6767
cd test_project
6868
touch index.html
69+
touch image.svg
70+
touch text.txt
71+
truncate -s 500MB big_file.txt
6972
date +"%Y-%m-%d %H:%M:%S,%3N" >> index.html
7073
cat index.html
7174
@@ -76,8 +79,8 @@ jobs:
7679
# SSH_PRIVATE_KEY: $EXAMPLE_SSH_PRIVATE_KEY
7780
# REMOTE_HOST: $EXAMPLE_REMOTE_HOST
7881
REMOTE_USER: ${{ env.TEST_USER }}
79-
ARGS: ${{ github.event.inputs.ARGS || '-rltgoDzvO --delete --chmod=ugo=rwX' }}
80-
SSH_CMD_ARGS: ${{ github.event.inputs.SSH_CMD_ARGS || '-o StrictHostKeyChecking=no, -o AnotherArg=7' }}
82+
ARGS: ${{ github.event.inputs.ARGS || '-rltgoDzvO --delete --chmod=ugo=rwX --progress' }}
83+
SSH_CMD_ARGS: ${{ github.event.inputs.SSH_CMD_ARGS || '-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null' }}
8184
SOURCE: "test_project/"
8285
TARGET: "/var/www/html/"
8386
EXCLUDE: ${{ github.event.inputs.EXCLUDE || '/dist/, /node_modules/' }}

‎dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/rsyncCli.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,17 @@ const rsyncCli = async ({
5151

5252
const defaultOptions = {
5353
ssh: true,
54-
recursive: true
54+
recursive: true,
55+
onStdout: (data) => console.log(data.toString()),
56+
onStderr: (data) => console.error(data.toString())
5557
};
5658

5759
// RSYNC COMMAND
5860
/* eslint-disable object-property-newline */
5961
return nodeRsyncPromise({
6062
...defaultOptions,
6163
src: source, dest: rsyncServer, excludeFirst: exclude, port: remotePort,
62-
privateKey: privateKeyPath, args, sshCmdArgs,
63-
onStdout: (data) => console.log(data), onStderr: (data) => console.error(data)
64+
privateKey: privateKeyPath, args, sshCmdArgs
6465
});
6566
};
6667

0 commit comments

Comments
 (0)
Please sign in to comment.