Compare commits

..

10 Commits

Author SHA1 Message Date
github-actions
a73c81ee7b chore(release): 3.3.4 [skip ci]
## [3.3.4](https://github.com/easingthemes/ssh-deploy/compare/v3.3.3...v3.3.4) (2023-01-02)

### Bug Fixes

* Add visible Rsync CMD for debugging ([91b6d28](91b6d280ae))
2023-01-02 21:59:55 +00:00
Dragan Filipovic
91b6d280ae fix: Add visible Rsync CMD for debugging 2023-01-02 22:59:19 +01:00
Dragan Filipovic
4f233a7f45 add bigger test files 2023-01-02 22:40:20 +01:00
github-actions
47f78aa96e chore(release): 3.3.3 [skip ci]
## [3.3.3](https://github.com/easingthemes/ssh-deploy/compare/v3.3.2...v3.3.3) (2023-01-02)

### Bug Fixes

* log buffer from rsync stdout ([8e19e0d](8e19e0d6bc))
2023-01-02 21:31:56 +00:00
Dragan Filipovic
8e19e0d6bc fix: log buffer from rsync stdout 2023-01-02 22:30:57 +01:00
Dragan Filipovic
da62405174 fix wrong args 2023-01-02 22:05:57 +01:00
Dragan Filipovic
2a85c96230 add more complex e2e tests 2023-01-02 22:02:16 +01:00
github-actions
ac90bba983 chore(release): 3.3.2 [skip ci]
## [3.3.2](https://github.com/easingthemes/ssh-deploy/compare/v3.3.1...v3.3.2) (2023-01-02)

### Bug Fixes

* Add manual inputs for e2e test ([8f71595](8f715957ab))
2023-01-02 20:46:02 +00:00
Dragan Filipovic
05ddb64347 Rebuild 2023-01-02 21:45:14 +01:00
Dragan Filipovic
8f715957ab fix: Add manual inputs for e2e test 2023-01-02 21:44:34 +01:00
5 changed files with 66 additions and 14 deletions

View File

@@ -3,6 +3,21 @@ name: e2e Test
on:
push:
branches: [ 'main' ]
workflow_dispatch:
inputs:
ARGS:
description: 'ARGS'
required: true
default: '-rltgoDzvO --delete --chmod=ugo=rwX --progress'
EXCLUDE:
description: 'EXCLUDE'
required: true
default: 'skip_dir/, /node_modules/'
SSH_CMD_ARGS:
description: 'SSH_CMD_ARGS'
required: true
default: '-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null'
env:
TEST_HOST_DOCKER: ./test
@@ -48,11 +63,18 @@ jobs:
- name: Create project file
run: |
mkdir test_project
cd test_project
mkdir test_project && cd "$_"
touch index.html
date +"%Y-%m-%d %H:%M:%S,%3N" >> index.html
truncate -s 50MB image.svg
truncate -s 5MB info.txt
truncate -s 500MB big_file.txt
mkdir skip_dir && cd "$_"
truncate -s 5MB text_in_skip_dir.txt
cd ../
cat index.html
echo "test_project: \n" && ls -l
echo "skip_dir: \n" && ls -l skip_dir
- name: e2e Test published ssh-deploy action
uses: easingthemes/ssh-deploy@main
@@ -61,14 +83,14 @@ jobs:
# SSH_PRIVATE_KEY: $EXAMPLE_SSH_PRIVATE_KEY
# REMOTE_HOST: $EXAMPLE_REMOTE_HOST
REMOTE_USER: ${{ env.TEST_USER }}
ARGS: "-rltgoDzvO"
ARGS: ${{ github.event.inputs.ARGS || '-rltgoDzvO --delete --chmod=ugo=rwX --progress' }}
SSH_CMD_ARGS: ${{ github.event.inputs.SSH_CMD_ARGS || '-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null' }}
SOURCE: "test_project/"
TARGET: "/var/www/html/"
EXCLUDE: "/dist/, /node_modules/"
EXCLUDE: ${{ github.event.inputs.EXCLUDE || 'skip_dir/, /node_modules/' }}
SCRIPT_BEFORE: |
whoami
ls -al
ls -al /var/www/html/
SCRIPT_AFTER: |
whoami
ls -al
ls -al /var/www/html/
echo $RSYNC_STDOUT

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,24 @@
## [3.3.4](https://github.com/easingthemes/ssh-deploy/compare/v3.3.3...v3.3.4) (2023-01-02)
### Bug Fixes
* Add visible Rsync CMD for debugging ([91b6d28](https://github.com/easingthemes/ssh-deploy/commit/91b6d280aee6a7ae666a11426fb356406f4a25a5))
## [3.3.3](https://github.com/easingthemes/ssh-deploy/compare/v3.3.2...v3.3.3) (2023-01-02)
### Bug Fixes
* log buffer from rsync stdout ([8e19e0d](https://github.com/easingthemes/ssh-deploy/commit/8e19e0d6bc9b1c332925ce0268ad64b50728fae5))
## [3.3.2](https://github.com/easingthemes/ssh-deploy/compare/v3.3.1...v3.3.2) (2023-01-02)
### Bug Fixes
* Add manual inputs for e2e test ([8f71595](https://github.com/easingthemes/ssh-deploy/commit/8f715957ab9283ab2934dd1e5be9d78f2eaf3fae))
## [3.3.1](https://github.com/easingthemes/ssh-deploy/compare/v3.3.0...v3.3.1) (2023-01-02)

View File

@@ -1,6 +1,6 @@
{
"name": "@draganfilipovic/ssh-deploy",
"version": "3.3.1",
"version": "3.3.4",
"description": "Fast NodeJS action to deploy specific directory from `GITHUB_WORKSPACE` to a server via rsync over ssh.",
"main": "dist/index.js",
"files": [

View File

@@ -2,6 +2,12 @@ const { execSync } = require('child_process');
const nodeRsync = require('rsyncwrapper');
const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
const logCMD = (cmd) => {
console.warn('================================================================');
console.log(cmd);
console.warn('================================================================');
};
try {
nodeRsync(config, (error, stdout, stderr, cmd) => {
if (error) {
@@ -11,10 +17,12 @@ const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
console.error(stderr);
console.error('❌️ [Rsync] stdout: ');
console.error(stdout);
console.error('❌ [Rsync] cmd: ', cmd);
console.error('❌ [Rsync] command: ');
logCMD(cmd);
reject(new Error(`${error.message}\n\n${stderr}`));
} else {
console.log('[Rsync] cmd finished: ', cmd);
console.log('[Rsync] command finished: ');
logCMD(cmd);
resolve(stdout);
}
});
@@ -51,7 +59,9 @@ const rsyncCli = async ({
const defaultOptions = {
ssh: true,
recursive: true
recursive: true,
onStdout: (data) => console.log(data.toString()),
onStderr: (data) => console.error(data.toString())
};
// RSYNC COMMAND
@@ -59,8 +69,7 @@ const rsyncCli = async ({
return nodeRsyncPromise({
...defaultOptions,
src: source, dest: rsyncServer, excludeFirst: exclude, port: remotePort,
privateKey: privateKeyPath, args, sshCmdArgs,
onStdout: (data) => console.log(data), onStderr: (data) => console.error(data)
privateKey: privateKeyPath, args, sshCmdArgs
});
};