Compare commits

...

3 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
5 changed files with 32 additions and 14 deletions

View File

@@ -12,7 +12,7 @@ on:
EXCLUDE: EXCLUDE:
description: 'EXCLUDE' description: 'EXCLUDE'
required: true required: true
default: '/dist/, /node_modules/' default: 'skip_dir/, /node_modules/'
SSH_CMD_ARGS: SSH_CMD_ARGS:
description: 'SSH_CMD_ARGS' description: 'SSH_CMD_ARGS'
required: true required: true
@@ -63,14 +63,18 @@ jobs:
- name: Create project file - name: Create project file
run: | run: |
mkdir test_project mkdir test_project && cd "$_"
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
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 cat index.html
echo "test_project: \n" && ls -l
echo "skip_dir: \n" && ls -l skip_dir
- name: e2e Test published ssh-deploy action - name: e2e Test published ssh-deploy action
uses: easingthemes/ssh-deploy@main uses: easingthemes/ssh-deploy@main
@@ -83,11 +87,10 @@ jobs:
SSH_CMD_ARGS: ${{ github.event.inputs.SSH_CMD_ARGS || '-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null' }} 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 || 'skip_dir/, /node_modules/' }}
SCRIPT_BEFORE: | SCRIPT_BEFORE: |
whoami whoami
ls -al ls -al /var/www/html/
SCRIPT_AFTER: | SCRIPT_AFTER: |
whoami ls -al /var/www/html/
ls -al
echo $RSYNC_STDOUT echo $RSYNC_STDOUT

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,10 @@
## [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) ## [3.3.3](https://github.com/easingthemes/ssh-deploy/compare/v3.3.2...v3.3.3) (2023-01-02)

View File

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

View File

@@ -2,6 +2,12 @@ const { execSync } = require('child_process');
const nodeRsync = require('rsyncwrapper'); const nodeRsync = require('rsyncwrapper');
const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => { const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
const logCMD = (cmd) => {
console.warn('================================================================');
console.log(cmd);
console.warn('================================================================');
};
try { try {
nodeRsync(config, (error, stdout, stderr, cmd) => { nodeRsync(config, (error, stdout, stderr, cmd) => {
if (error) { if (error) {
@@ -11,10 +17,12 @@ const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
console.error(stderr); console.error(stderr);
console.error('❌️ [Rsync] stdout: '); console.error('❌️ [Rsync] stdout: ');
console.error(stdout); console.error(stdout);
console.error('❌ [Rsync] cmd: ', cmd); console.error('❌ [Rsync] command: ');
logCMD(cmd);
reject(new Error(`${error.message}\n\n${stderr}`)); reject(new Error(`${error.message}\n\n${stderr}`));
} else { } else {
console.log('⭐ [Rsync] cmd finished: ', cmd); console.log('⭐ [Rsync] command finished: ');
logCMD(cmd);
resolve(stdout); resolve(stdout);
} }
}); });