mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2024-11-19 08:08:05 +08:00
Compare commits
23 Commits
v3.4.2
...
manual-rel
Author | SHA1 | Date | |
---|---|---|---|
|
245b7a9d2f | ||
|
4c8eee72bd | ||
|
0a1df91f97 | ||
|
845b7f6f1f | ||
|
2a32c8dcde | ||
|
0b63b85565 | ||
|
450bf423f3 | ||
|
affc58a8b7 | ||
|
8c12d45929 | ||
|
85987f4567 | ||
|
3ef66d0be9 | ||
|
79363f2b74 | ||
|
7c21074882 | ||
|
9f191f4263 | ||
|
006cf3021d | ||
|
8be4106fce | ||
|
7c9b40539e | ||
|
2169399fef | ||
|
2be7efb376 | ||
|
e6e41a57ec | ||
|
c8d57ec8b4 | ||
|
8bf58fb293 | ||
|
6d3554b01e |
2
.github/workflows/e2e-manual.yml
vendored
2
.github/workflows/e2e-manual.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
ARGS:
|
ARGS:
|
||||||
description: 'ARGS'
|
description: 'ARGS'
|
||||||
required: true
|
required: true
|
||||||
default: '-rltgoDzvO --delete --chmod=ugo+rwX --progress'
|
default: '-rlgoDzvc -i --delete --chmod=ugo+rwX --progress'
|
||||||
EXCLUDE:
|
EXCLUDE:
|
||||||
description: 'EXCLUDE'
|
description: 'EXCLUDE'
|
||||||
required: true
|
required: true
|
||||||
|
75
.github/workflows/e2e.yml
vendored
75
.github/workflows/e2e.yml
vendored
@@ -74,7 +74,7 @@ jobs:
|
|||||||
|
|
||||||
- name: set shared ENV variables for multi target deployment
|
- name: set shared ENV variables for multi target deployment
|
||||||
run: |
|
run: |
|
||||||
echo "ARGS=-rltgoDzvOR --delete --chmod=ugo+rwX --progress" >> $GITHUB_ENV
|
echo "ARGS=-rlgoDzvcR -i --delete --chmod=ugo+rwX --progress" >> $GITHUB_ENV
|
||||||
echo "SSH_CMD_ARGS=-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null" >> $GITHUB_ENV
|
echo "SSH_CMD_ARGS=-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null" >> $GITHUB_ENV
|
||||||
echo "SOURCE=test_project/ test_project2/" >> $GITHUB_ENV
|
echo "SOURCE=test_project/ test_project2/" >> $GITHUB_ENV
|
||||||
echo "EXCLUDE=skip_dir/, /node_modules/" >> $GITHUB_ENV
|
echo "EXCLUDE=skip_dir/, /node_modules/" >> $GITHUB_ENV
|
||||||
@@ -95,8 +95,79 @@ jobs:
|
|||||||
TARGET: /var/www/html/${{ env.TEST_USER }}
|
TARGET: /var/www/html/${{ env.TEST_USER }}
|
||||||
|
|
||||||
- name: e2e Test ssh-deploy action - Target 2
|
- name: e2e Test ssh-deploy action - Target 2
|
||||||
uses: easingthemes/ssh-deploy@feature/multi-src
|
uses: easingthemes/ssh-deploy@main
|
||||||
env:
|
env:
|
||||||
# Shared ENV Vars created in previous steps
|
# Shared ENV Vars created in previous steps
|
||||||
REMOTE_USER: ${{ env.TEST_USER2 }}
|
REMOTE_USER: ${{ env.TEST_USER2 }}
|
||||||
TARGET: /var/www/html/${{ env.TEST_USER2 }}
|
TARGET: /var/www/html/${{ env.TEST_USER2 }}
|
||||||
|
e2e-v3:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# : ---------------------------------------------------------------
|
||||||
|
# : START E2E Test Specific - steps
|
||||||
|
# : ----------------------------------------------------------------
|
||||||
|
|
||||||
|
- name: E2E Test Specific - Clean up old test files
|
||||||
|
run: |
|
||||||
|
docker stop ssh-host-container || true && docker rm ssh-host-container || true
|
||||||
|
|
||||||
|
- name: E2E Test Specific - Create ssh keys
|
||||||
|
run: |
|
||||||
|
echo $HOME
|
||||||
|
ls -la $HOME
|
||||||
|
ssh-keygen -m PEM -t rsa -b 4096 -f "$HOME/.ssh/id_rsa" -N ""
|
||||||
|
eval `ssh-agent -s`
|
||||||
|
ssh-add "$HOME/.ssh/id_rsa"
|
||||||
|
ssh-add -l
|
||||||
|
echo "SSH_PRIVATE_KEY<<EOF" >> $GITHUB_ENV
|
||||||
|
cat $HOME/.ssh/id_rsa >> $GITHUB_ENV
|
||||||
|
echo "EOF" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: E2E Test Specific - Build Host Server Image
|
||||||
|
working-directory: ${{ env.TEST_HOST_DOCKER }}
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
-t ssh-host-image . \
|
||||||
|
--build-arg SSH_PUB_KEY="$(cat $HOME/.ssh/id_rsa.pub)"
|
||||||
|
docker run -d -p 8822:22 --name=ssh-host-container ssh-host-image
|
||||||
|
docker exec ssh-host-container sh -c "hostname --ip-address" > ip.txt
|
||||||
|
echo "REMOTE_HOST<<EOF" >> $GITHUB_ENV
|
||||||
|
cat ip.txt >> $GITHUB_ENV
|
||||||
|
echo "EOF" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: E2E Test Specific - Create project file
|
||||||
|
run: |
|
||||||
|
mkdir test_project2 && cd "$_"
|
||||||
|
truncate -s 5MB info2.txt
|
||||||
|
cd ../
|
||||||
|
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:" && ls -lR
|
||||||
|
echo "skip_dir:" && ls -lR skip_dir
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------
|
||||||
|
# END E2E Test Specific - steps
|
||||||
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
|
- name: e2e Test ssh-deploy action - Target 1
|
||||||
|
uses: easingthemes/ssh-deploy@v3
|
||||||
|
env:
|
||||||
|
# Shared ENV Vars created in previous steps
|
||||||
|
REMOTE_USER: ${{ env.TEST_USER }}
|
||||||
|
TARGET: /var/www/html/${{ env.TEST_USER }}
|
||||||
|
SOURCE: test_project/
|
||||||
|
EXCLUDE: skip_dir/, /node_modules/
|
||||||
|
ARGS: -rlgoDzvcO
|
||||||
|
9
.github/workflows/manual-release.yml
vendored
9
.github/workflows/manual-release.yml
vendored
@@ -6,11 +6,10 @@ on:
|
|||||||
description: 'Version'
|
description: 'Version'
|
||||||
type: choice
|
type: choice
|
||||||
required: true
|
required: true
|
||||||
default: patch
|
default: fix
|
||||||
options:
|
options:
|
||||||
- patch
|
- fix
|
||||||
- minor
|
- feat
|
||||||
- major
|
|
||||||
dryRun:
|
dryRun:
|
||||||
description: 'DryRun'
|
description: 'DryRun'
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -64,7 +63,7 @@ jobs:
|
|||||||
run: npm run build --if-present
|
run: npm run build --if-present
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: npm test --if-present
|
run: npm test --if-present
|
||||||
- name: Publish npm package
|
- name: Create a release - ${{ github.event.inputs.version }}
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v3
|
||||||
with:
|
with:
|
||||||
dry_run: ${{ github.event.inputs.dryRun == 'true' }}
|
dry_run: ${{ github.event.inputs.dryRun == 'true' }}
|
||||||
|
@@ -41,7 +41,7 @@ eg: myusername
|
|||||||
|
|
||||||
eg: '59184'
|
eg: '59184'
|
||||||
|
|
||||||
##### 5. `ARGS` (optional, default '-rltgoDzvO')
|
##### 5. `ARGS` (optional, default '-rlgoDzvc -i')
|
||||||
|
|
||||||
For any initial/required rsync flags, eg: `-avzr --delete`
|
For any initial/required rsync flags, eg: `-avzr --delete`
|
||||||
|
|
||||||
@@ -62,6 +62,8 @@ path to exclude separated by `,`, ie: `/dist/, /node_modules/`
|
|||||||
|
|
||||||
Script to run on host machine before rsync. Single line or multiline commands.
|
Script to run on host machine before rsync. Single line or multiline commands.
|
||||||
Execution is preformed by storing commands in `.sh` file and executing it via `.bash` over `ssh`
|
Execution is preformed by storing commands in `.sh` file and executing it via `.bash` over `ssh`
|
||||||
|
If you have issues with `ssh` connection, use this var, eg `SCRIPT_BEFORE: ls`.
|
||||||
|
This will force `known_hosts` update, adding your host via `ssh-keyscan`.
|
||||||
|
|
||||||
##### 10. `SCRIPT_AFTER` (optional, default '')
|
##### 10. `SCRIPT_AFTER` (optional, default '')
|
||||||
|
|
||||||
@@ -83,7 +85,7 @@ or use the latest version from a branch, eg: ssh-deploy@main
|
|||||||
uses: easingthemes/ssh-deploy@main
|
uses: easingthemes/ssh-deploy@main
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
ARGS: "-rltgoDzvO"
|
ARGS: "-rlgoDzvc -i"
|
||||||
SOURCE: "dist/"
|
SOURCE: "dist/"
|
||||||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
||||||
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
||||||
@@ -124,7 +126,7 @@ jobs:
|
|||||||
uses: easingthemes/ssh-deploy@main
|
uses: easingthemes/ssh-deploy@main
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
ARGS: "-rltgoDzvO --delete"
|
ARGS: "-rlgoDzvc -i --delete"
|
||||||
SOURCE: "dist/"
|
SOURCE: "dist/"
|
||||||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
||||||
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
||||||
@@ -156,6 +158,7 @@ For complex use cases, use `ARGS` and `SSH_CMD_ARGS` to fully configure `rsync`
|
|||||||
- If you need to use multiple steps, eg multi targets deployment, save shared ENV variables in `>> $GITHUB_ENV`.
|
- If you need to use multiple steps, eg multi targets deployment, save shared ENV variables in `>> $GITHUB_ENV`.
|
||||||
Check .github/workflows/e2e.yml for an example
|
Check .github/workflows/e2e.yml for an example
|
||||||
- For multi sources, use -R ARG to manipulate folders structure.
|
- For multi sources, use -R ARG to manipulate folders structure.
|
||||||
|
- Great post about `rsync` options specific to usage of this action: https://logansnotes.com/2020/gh-action-site-deploy/
|
||||||
|
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
@@ -26,7 +26,7 @@ inputs:
|
|||||||
ARGS:
|
ARGS:
|
||||||
description: "Arguments to pass to rsync"
|
description: "Arguments to pass to rsync"
|
||||||
required: false
|
required: false
|
||||||
default: "-rltgoDzvO"
|
default: "-rlgoDzvc -i"
|
||||||
SSH_CMD_ARGS:
|
SSH_CMD_ARGS:
|
||||||
description: "An array of ssh arguments, they must be prefixed with -o and separated by a comma, for example: -o SomeArgument=no, -o SomeOtherArgument=5 "
|
description: "An array of ssh arguments, they must be prefixed with -o and separated by a comma, for example: -o SomeArgument=no, -o SomeOtherArgument=5 "
|
||||||
required: false
|
required: false
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,3 +1,56 @@
|
|||||||
|
## [4.0.4](https://github.com/easingthemes/ssh-deploy/compare/v4.0.3...v4.0.4) (2023-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* update sub dependencies ([2a32c8d](https://github.com/easingthemes/ssh-deploy/commit/2a32c8dcde2d64394a3577decdd9c902f37a30f8))
|
||||||
|
|
||||||
|
## [4.0.3](https://github.com/easingthemes/ssh-deploy/compare/v4.0.2...v4.0.3) (2023-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* update v3 e2e test ([450bf42](https://github.com/easingthemes/ssh-deploy/commit/450bf423f388777bde052ad7b5bc24eca392434d))
|
||||||
|
|
||||||
|
## [4.0.2](https://github.com/easingthemes/ssh-deploy/compare/v4.0.1...v4.0.2) (2023-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add githubWorkspace as default source root ([3ef66d0](https://github.com/easingthemes/ssh-deploy/commit/3ef66d0be999ee45434505e8bedea4f8b5b5a909))
|
||||||
|
|
||||||
|
## [4.0.1](https://github.com/easingthemes/ssh-deploy/compare/v4.0.0...v4.0.1) (2023-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix default source if empty ([9f191f4](https://github.com/easingthemes/ssh-deploy/commit/9f191f42633c4a0f66054f0fc229c9e30a08f00c))
|
||||||
|
|
||||||
|
# [4.0.0](https://github.com/easingthemes/ssh-deploy/compare/v3.4.3...v4.0.0) (2023-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* rebuild ([2169399](https://github.com/easingthemes/ssh-deploy/commit/2169399fef9a60a2fea1ab03cce4ec8c2371e5c2))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* update default rsync options ([2be7efb](https://github.com/easingthemes/ssh-deploy/commit/2be7efb376866327c1d1209f51eb43f34f07b354))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* Default rsync options updated to speed up default deployments.
|
||||||
|
from `rltgoDzvO` to `-rlgoDzvc -i`
|
||||||
|
|
||||||
|
## [3.4.3](https://github.com/easingthemes/ssh-deploy/compare/v3.4.2...v3.4.3) (2023-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* move e2e tests typo branch name ([6d3554b](https://github.com/easingthemes/ssh-deploy/commit/6d3554b01e9a05de9a9d2b30274bee411a4986ed))
|
||||||
|
|
||||||
## [3.4.2](https://github.com/easingthemes/ssh-deploy/compare/v3.4.1...v3.4.2) (2023-01-03)
|
## [3.4.2](https://github.com/easingthemes/ssh-deploy/compare/v3.4.1...v3.4.2) (2023-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
106
package-lock.json
generated
106
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@draganfilipovic/ssh-deploy",
|
"name": "@draganfilipovic/ssh-deploy",
|
||||||
"version": "3.1.0",
|
"version": "4.0.4",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@draganfilipovic/ssh-deploy",
|
"name": "@draganfilipovic/ssh-deploy",
|
||||||
"version": "3.1.0",
|
"version": "4.0.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"rsyncwrapper": "^3.0.1"
|
"rsyncwrapper": "^3.0.1"
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/eslintrc": {
|
"node_modules/@eslint/eslintrc": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
|
||||||
"integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==",
|
"integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.12.4",
|
||||||
@@ -326,21 +326,6 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cross-spawn/node_modules/which": {
|
|
||||||
"version": "2.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
|
||||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"isexe": "^2.0.0"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"node-which": "bin/node-which"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
"version": "4.3.4",
|
"version": "4.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||||
@@ -470,12 +455,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "8.30.0",
|
"version": "8.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz",
|
||||||
"integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==",
|
"integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/eslintrc": "^1.4.0",
|
"@eslint/eslintrc": "^1.4.1",
|
||||||
"@humanwhocodes/config-array": "^0.11.8",
|
"@humanwhocodes/config-array": "^0.11.8",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@nodelib/fs.walk": "^1.2.8",
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
@@ -770,9 +755,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/fastq": {
|
"node_modules/fastq": {
|
||||||
"version": "1.14.0",
|
"version": "1.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
|
||||||
"integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==",
|
"integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"reusify": "^1.0.4"
|
"reusify": "^1.0.4"
|
||||||
@@ -1327,9 +1312,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/json5": {
|
"node_modules/json5": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||||
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
@@ -1931,6 +1916,21 @@
|
|||||||
"punycode": "^2.1.0"
|
"punycode": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/which": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"node-which": "bin/node-which"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/which-boxed-primitive": {
|
"node_modules/which-boxed-primitive": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
|
||||||
@@ -1977,9 +1977,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/eslintrc": {
|
"@eslint/eslintrc": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
|
||||||
"integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==",
|
"integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.12.4",
|
||||||
@@ -2203,17 +2203,6 @@
|
|||||||
"path-key": "^3.1.0",
|
"path-key": "^3.1.0",
|
||||||
"shebang-command": "^2.0.0",
|
"shebang-command": "^2.0.0",
|
||||||
"which": "^2.0.1"
|
"which": "^2.0.1"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"which": {
|
|
||||||
"version": "2.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
|
||||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"isexe": "^2.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
@@ -2310,12 +2299,12 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"eslint": {
|
"eslint": {
|
||||||
"version": "8.30.0",
|
"version": "8.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz",
|
||||||
"integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==",
|
"integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@eslint/eslintrc": "^1.4.0",
|
"@eslint/eslintrc": "^1.4.1",
|
||||||
"@humanwhocodes/config-array": "^0.11.8",
|
"@humanwhocodes/config-array": "^0.11.8",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@nodelib/fs.walk": "^1.2.8",
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
@@ -2549,9 +2538,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"fastq": {
|
"fastq": {
|
||||||
"version": "1.14.0",
|
"version": "1.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
|
||||||
"integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==",
|
"integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"reusify": "^1.0.4"
|
"reusify": "^1.0.4"
|
||||||
@@ -2943,9 +2932,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"json5": {
|
"json5": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||||
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
@@ -3359,6 +3348,15 @@
|
|||||||
"punycode": "^2.1.0"
|
"punycode": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"which": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"which-boxed-primitive": {
|
"which-boxed-primitive": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@draganfilipovic/ssh-deploy",
|
"name": "@draganfilipovic/ssh-deploy",
|
||||||
"version": "3.4.2",
|
"version": "4.0.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": [
|
||||||
|
@@ -10,10 +10,10 @@ const githubWorkspace = process.env.GITHUB_WORKSPACE;
|
|||||||
const remoteUser = process.env.REMOTE_USER;
|
const remoteUser = process.env.REMOTE_USER;
|
||||||
|
|
||||||
const defaultInputs = {
|
const defaultInputs = {
|
||||||
source: './',
|
source: '',
|
||||||
target: `/home/${remoteUser}/`,
|
target: `/home/${remoteUser}/`,
|
||||||
exclude: '',
|
exclude: '',
|
||||||
args: '-rltgoDzvO',
|
args: '-rlgoDzvc -i',
|
||||||
sshCmdArgs: '-o StrictHostKeyChecking=no',
|
sshCmdArgs: '-o StrictHostKeyChecking=no',
|
||||||
deployKeyName: `deploy_key_${remoteUser}_${Date.now()}`
|
deployKeyName: `deploy_key_${remoteUser}_${Date.now()}`
|
||||||
};
|
};
|
||||||
@@ -30,7 +30,7 @@ inputNames.forEach((input) => {
|
|||||||
// eslint-disable-next-line default-case
|
// eslint-disable-next-line default-case
|
||||||
switch (inputName) {
|
switch (inputName) {
|
||||||
case 'source':
|
case 'source':
|
||||||
extendedVal = validVal.indexOf(' ') > -1 ? validVal.split(' ') : validVal;
|
extendedVal = validVal.split(' ').map((src) => `${githubWorkspace}/${src}`);
|
||||||
break;
|
break;
|
||||||
case 'args':
|
case 'args':
|
||||||
extendedVal = validVal.split(' ');
|
extendedVal = validVal.split(' ');
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
const { exec } = require('child_process');
|
const { exec } = require('child_process');
|
||||||
const { sshServer, githubWorkspace } = require('./inputs');
|
const { sshServer, githubWorkspace, remotePort } = require('./inputs');
|
||||||
const { writeToFile } = require('./helpers');
|
const { writeToFile } = require('./helpers');
|
||||||
|
|
||||||
const handleError = (message, isRequired, callback) => {
|
const handleError = (message, isRequired, callback) => {
|
||||||
@@ -17,7 +17,7 @@ const remoteCmd = async (content, privateKeyPath, isRequired, label) => new Prom
|
|||||||
writeToFile({ dir: githubWorkspace, filename, content });
|
writeToFile({ dir: githubWorkspace, filename, content });
|
||||||
console.log(`Executing remote script: ssh -i ${privateKeyPath} ${sshServer}`);
|
console.log(`Executing remote script: ssh -i ${privateKeyPath} ${sshServer}`);
|
||||||
exec(
|
exec(
|
||||||
`DEBIAN_FRONTEND=noninteractive ssh -i ${privateKeyPath} -o StrictHostKeyChecking=no ${sshServer} 'RSYNC_STDOUT="${process.env.RSYNC_STDOUT}" bash -s' < ${filename}`,
|
`DEBIAN_FRONTEND=noninteractive ssh -p ${(remotePort || 22)} -i ${privateKeyPath} -o StrictHostKeyChecking=no ${sshServer} 'RSYNC_STDOUT="${process.env.RSYNC_STDOUT}" bash -s' < ${filename}`,
|
||||||
(err, data, stderr) => {
|
(err, data, stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
const message = `⚠️ [CMD] Remote script failed: ${err.message}`;
|
const message = `⚠️ [CMD] Remote script failed: ${err.message}`;
|
||||||
|
Reference in New Issue
Block a user