mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2024-11-19 08:08:05 +08:00
Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b12dcbe93c | ||
|
c984a47bf5 | ||
|
5e456a475a | ||
|
a9eda89ad7 | ||
|
3cfa1cdc25 | ||
|
ce56d75fc1 | ||
|
74b3a2aba4 | ||
|
77bfc8c169 | ||
|
ac3c9b51d5 | ||
|
a0be893c82 | ||
|
50d1f576f9 | ||
|
20a0cae1ae | ||
|
95f4dc8069 | ||
|
b2adc00c92 | ||
|
a50a999528 | ||
|
1242867d7a | ||
|
33648ba2ca | ||
|
40a3789c05 | ||
|
7e2c0f29d6 | ||
|
e9c43c6900 | ||
|
9ae3c340cb | ||
|
386c8766a0 | ||
|
130901534a | ||
|
8b977327bb | ||
|
880f3b6b88 | ||
|
ec4a00fe02 | ||
|
a04c641775 | ||
|
9483c83d88 | ||
|
e41d593e15 |
31
.github/workflows/build.yml
vendored
Normal file
31
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '**' ]
|
||||
pull_request:
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Build Library
|
||||
run: npm run build
|
||||
- name: Run Tests
|
||||
run: npm test --if-present
|
47
.github/workflows/codeql-analysis.yml
vendored
Normal file
47
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
- cron: '20 12 * * 0'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- run: |
|
||||
npm ci
|
||||
npm run build --if-present
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
43
.github/workflows/manual-release.yml
vendored
Normal file
43
.github/workflows/manual-release.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Manual Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dryrun:
|
||||
description: 'DryRUn'
|
||||
required: true
|
||||
default: 'false'
|
||||
jobs:
|
||||
release:
|
||||
name: Test, Build and Release
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
node-version: [ 14.x ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix['node-version'] }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Build Library
|
||||
run: npm run build --if-present
|
||||
- name: Run Tests
|
||||
run: npm test --if-present
|
||||
- name: Release
|
||||
uses: cycjimmy/semantic-release-action@v2
|
||||
with:
|
||||
dry_run: ${{ github.event.inputs.dryrun == 'true' }}
|
||||
extra_plugins: |
|
||||
@semantic-release/changelog@3.0.0
|
||||
@semantic-release/git
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GIT_AUTHOR_NAME: github-actions
|
||||
GIT_AUTHOR_EMAIL: github-actions@github.com
|
||||
GIT_COMMITTER_NAME: github-actions
|
||||
GIT_COMMITTER_EMAIL: github-actions@github.com
|
||||
CI: true
|
43
.github/workflows/release.yml
vendored
Normal file
43
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Test, Build and Release
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
node-version: [ 14.x ]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix['node-version'] }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Build Library
|
||||
run: npm run build --if-present
|
||||
- name: Run Tests
|
||||
run: npm test --if-present
|
||||
- name: Release
|
||||
uses: cycjimmy/semantic-release-action@v2
|
||||
with:
|
||||
dry_run: false
|
||||
extra_plugins: |
|
||||
@semantic-release/changelog@3.0.0
|
||||
@semantic-release/git
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GIT_AUTHOR_NAME: github-actions
|
||||
GIT_AUTHOR_EMAIL: github-actions@github.com
|
||||
GIT_COMMITTER_NAME: github-actions
|
||||
GIT_COMMITTER_EMAIL: github-actions@github.com
|
||||
CI: true
|
20
.releaserc
Normal file
20
.releaserc
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"branches": ["main"],
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
[
|
||||
"@semantic-release/changelog",
|
||||
{
|
||||
"changelogFile": "docs/CHANGELOG.md"
|
||||
}
|
||||
],
|
||||
"@semantic-release/npm",
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": ["docs/CHANGELOG.md"]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
480
dist/index.js
vendored
480
dist/index.js
vendored
@@ -1,111 +1,25 @@
|
||||
#!/usr/bin/env node
|
||||
module.exports =
|
||||
/******/ (function(modules, runtime) { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ __webpack_require__.ab = __dirname + "/";
|
||||
/******/
|
||||
/******/ // the startup function
|
||||
/******/ function startup() {
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(676);
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // run startup
|
||||
/******/ return startup();
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 129:
|
||||
/***/ (function(module) {
|
||||
/***/ 569:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
module.exports = require("child_process");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 197:
|
||||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||
|
||||
const { existsSync, mkdirSync, writeFileSync } = __webpack_require__(747);
|
||||
|
||||
const {
|
||||
GITHUB_WORKSPACE
|
||||
} = process.env;
|
||||
|
||||
const validateDir = (dir) => {
|
||||
if (!existsSync(dir)) {
|
||||
console.log(`[SSH] Creating ${dir} dir in `, GITHUB_WORKSPACE);
|
||||
mkdirSync(dir);
|
||||
console.log('✅ [SSH] dir created.');
|
||||
} else {
|
||||
console.log(`[SSH] ${dir} dir exist`);
|
||||
}
|
||||
};
|
||||
|
||||
const validateFile = (filePath) => {
|
||||
if (!existsSync(filePath)) {
|
||||
console.log(`[SSH] Creating ${filePath} file in `, GITHUB_WORKSPACE);
|
||||
try {
|
||||
writeFileSync(filePath, '', {
|
||||
encoding: 'utf8',
|
||||
mode: 0o600
|
||||
});
|
||||
console.log('✅ [SSH] file created.');
|
||||
} catch (e) {
|
||||
console.error('⚠️ [SSH] writeFileSync error', filePath, e.message);
|
||||
process.abort();
|
||||
}
|
||||
} else {
|
||||
console.log(`[SSH] ${filePath} file exist`);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
validateDir,
|
||||
validateFile
|
||||
};
|
||||
module.exports = __nccwpck_require__(325);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 243:
|
||||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||
/***/ 325:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var exec = __webpack_require__(129).exec;
|
||||
var execSync = __webpack_require__(129).execSync;
|
||||
var fs = __webpack_require__(747);
|
||||
var path = __webpack_require__(622);
|
||||
var exec = __nccwpck_require__(129).exec;
|
||||
var execSync = __nccwpck_require__(129).execSync;
|
||||
var fs = __nccwpck_require__(747);
|
||||
var path = __nccwpck_require__(622);
|
||||
var access = fs.access;
|
||||
var accessSync = fs.accessSync;
|
||||
var constants = fs.constants || fs;
|
||||
@@ -164,7 +78,8 @@ var commandExistsUnix = function(commandName, cleanedCommandName, callback) {
|
||||
}
|
||||
|
||||
var commandExistsWindows = function(commandName, cleanedCommandName, callback) {
|
||||
if (/[\x00-\x1f<>:"\|\?\*]/.test(commandName)) {
|
||||
// Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator
|
||||
if (!(/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(commandName))) {
|
||||
callback(null, false);
|
||||
return;
|
||||
}
|
||||
@@ -195,7 +110,8 @@ var commandExistsUnixSync = function(commandName, cleanedCommandName) {
|
||||
}
|
||||
|
||||
var commandExistsWindowsSync = function(commandName, cleanedCommandName, callback) {
|
||||
if (/[\x00-\x1f<>:"\|\?\*]/.test(commandName)) {
|
||||
// Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator
|
||||
if (!(/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(commandName))) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
@@ -259,14 +175,66 @@ module.exports.sync = function(commandName) {
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 250:
|
||||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||
/***/ 748:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
const { exec, execSync } = __nccwpck_require__(129);
|
||||
|
||||
const commandline={
|
||||
run:runCommand,
|
||||
runSync:runSync,
|
||||
//will be deprecated soon as run is now the same.
|
||||
get:runCommand,
|
||||
|
||||
};
|
||||
|
||||
function runCommand(command,callback){
|
||||
|
||||
return exec(
|
||||
command,
|
||||
(
|
||||
function(){
|
||||
return function(err,data,stderr){
|
||||
if(!callback)
|
||||
return;
|
||||
|
||||
callback(err, data, stderr);
|
||||
}
|
||||
}
|
||||
)(callback)
|
||||
);
|
||||
}
|
||||
|
||||
function runSync(command){
|
||||
try {
|
||||
return {
|
||||
data: execSync(command).toString(),
|
||||
err: null,
|
||||
stderr: null
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
return {
|
||||
data: null,
|
||||
err: error.stderr.toString(),
|
||||
stderr: error.stderr.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports=commandline;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 898:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var spawn = __webpack_require__(129).spawn
|
||||
var util = __webpack_require__(669)
|
||||
var spawn = __nccwpck_require__(129).spawn
|
||||
var util = __nccwpck_require__(669)
|
||||
|
||||
var escapeSpaces = function(path) {
|
||||
if (typeof path === 'string') {
|
||||
@@ -463,55 +431,132 @@ module.exports = function(options, callback) {
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 428:
|
||||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||
/***/ 505:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
var exec = __webpack_require__(129).exec;
|
||||
const { existsSync, mkdirSync, writeFileSync } = __nccwpck_require__(747);
|
||||
|
||||
var commandline={
|
||||
get:getString,
|
||||
run:runCommand
|
||||
const {
|
||||
GITHUB_WORKSPACE
|
||||
} = process.env;
|
||||
|
||||
const validateDir = (dir) => {
|
||||
if (!existsSync(dir)) {
|
||||
console.log(`[SSH] Creating ${dir} dir in `, GITHUB_WORKSPACE);
|
||||
mkdirSync(dir);
|
||||
console.log('✅ [SSH] dir created.');
|
||||
} else {
|
||||
console.log(`[SSH] ${dir} dir exist`);
|
||||
}
|
||||
};
|
||||
|
||||
function runCommand(command){
|
||||
//return refrence to the child process
|
||||
return exec(
|
||||
command
|
||||
);
|
||||
}
|
||||
const validateFile = (filePath) => {
|
||||
if (!existsSync(filePath)) {
|
||||
console.log(`[SSH] Creating ${filePath} file in `, GITHUB_WORKSPACE);
|
||||
try {
|
||||
writeFileSync(filePath, '', {
|
||||
encoding: 'utf8',
|
||||
mode: 0o600
|
||||
});
|
||||
console.log('✅ [SSH] file created.');
|
||||
} catch (e) {
|
||||
console.error('⚠️ [SSH] writeFileSync error', filePath, e.message);
|
||||
process.abort();
|
||||
}
|
||||
} else {
|
||||
console.log(`[SSH] ${filePath} file exist`);
|
||||
}
|
||||
};
|
||||
|
||||
function getString(command,callback){
|
||||
//return refrence to the child process
|
||||
return exec(
|
||||
command,
|
||||
(
|
||||
function(){
|
||||
return function(err,data,stderr){
|
||||
if(!callback)
|
||||
return;
|
||||
|
||||
callback(err, data, stderr);
|
||||
}
|
||||
}
|
||||
)(callback)
|
||||
);
|
||||
}
|
||||
|
||||
module.exports=commandline;
|
||||
module.exports = {
|
||||
validateDir,
|
||||
validateFile
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 613:
|
||||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||
/***/ 229:
|
||||
/***/ ((module) => {
|
||||
|
||||
const { writeFileSync } = __webpack_require__(747);
|
||||
const { join } = __webpack_require__(622);
|
||||
const inputNames = ['REMOTE_HOST', 'REMOTE_USER', 'REMOTE_PORT', 'SSH_PRIVATE_KEY', 'DEPLOY_KEY_NAME', 'SOURCE', 'TARGET', 'ARGS', 'EXCLUDE'];
|
||||
|
||||
const inputs = {
|
||||
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE
|
||||
};
|
||||
// Get inputs from ENV or WITH workflow settings
|
||||
inputNames.forEach((input) => {
|
||||
inputs[input] = process.env[input] || process.env[`INPUT_${input}`];
|
||||
});
|
||||
|
||||
module.exports = inputs;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 447:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
const { sync: commandExists } = __nccwpck_require__(569);
|
||||
const { get: nodeCmd } = __nccwpck_require__(748);
|
||||
|
||||
const validateRsync = (callback = () => {}) => {
|
||||
const rsyncCli = commandExists('rsync');
|
||||
|
||||
if (!rsyncCli) {
|
||||
nodeCmd(
|
||||
'sudo apt-get --no-install-recommends install rsync',
|
||||
(err, data, stderr) => {
|
||||
if (err) {
|
||||
console.log('⚠️ [CLI] Rsync installation failed. Aborting ... ', err.message);
|
||||
process.abort();
|
||||
} else {
|
||||
console.log('✅ [CLI] Rsync installed. \n', data, stderr);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const validateInputs = (inputs) => {
|
||||
const inputKeys = Object.keys(inputs);
|
||||
const validInputs = inputKeys.filter((inputKey) => {
|
||||
const inputValue = inputs[inputKey];
|
||||
|
||||
if (!inputValue) {
|
||||
console.error(`⚠️ [INPUTS] ${inputKey} is mandatory`);
|
||||
}
|
||||
|
||||
return inputValue;
|
||||
});
|
||||
|
||||
if (validInputs.length !== inputKeys.length) {
|
||||
console.error('⚠️ [INPUTS] Inputs not valid, aborting ...');
|
||||
process.abort();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
validateRsync,
|
||||
validateInputs
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 822:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
const { writeFileSync } = __nccwpck_require__(747);
|
||||
const { join } = __nccwpck_require__(622);
|
||||
|
||||
const {
|
||||
validateDir,
|
||||
validateFile
|
||||
} = __webpack_require__(197);
|
||||
} = __nccwpck_require__(505);
|
||||
|
||||
const {
|
||||
HOME
|
||||
@@ -546,52 +591,88 @@ module.exports = {
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 622:
|
||||
/***/ (function(module) {
|
||||
/***/ 129:
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = require("path");
|
||||
"use strict";
|
||||
module.exports = require("child_process");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 659:
|
||||
/***/ (function(module) {
|
||||
/***/ 747:
|
||||
/***/ ((module) => {
|
||||
|
||||
const inputNames = ['REMOTE_HOST', 'REMOTE_USER', 'REMOTE_PORT', 'SSH_PRIVATE_KEY', 'DEPLOY_KEY_NAME', 'SOURCE', 'TARGET', 'ARGS', 'EXCLUDE'];
|
||||
"use strict";
|
||||
module.exports = require("fs");;
|
||||
|
||||
const inputs = {
|
||||
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE
|
||||
};
|
||||
// Get inputs from ENV or WITH workflow settings
|
||||
inputNames.forEach((input) => {
|
||||
inputs[input] = process.env[input] || process.env[`INPUT_${input}`];
|
||||
});
|
||||
/***/ }),
|
||||
|
||||
module.exports = inputs;
|
||||
/***/ 622:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("path");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 669:
|
||||
/***/ (function(module) {
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = require("util");
|
||||
"use strict";
|
||||
module.exports = require("util");;
|
||||
|
||||
/***/ }),
|
||||
/***/ })
|
||||
|
||||
/***/ 676:
|
||||
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __nccwpck_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ var threw = true;
|
||||
/******/ try {
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
||||
/******/ threw = false;
|
||||
/******/ } finally {
|
||||
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat */
|
||||
/******/
|
||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
||||
(() => {
|
||||
const nodeRsync = __nccwpck_require__(898);
|
||||
|
||||
const nodeRsync = __webpack_require__(250);
|
||||
|
||||
const { validateRsync, validateInputs } = __webpack_require__(735);
|
||||
const { addSshKey } = __webpack_require__(613);
|
||||
const { validateRsync, validateInputs } = __nccwpck_require__(447);
|
||||
const { addSshKey } = __nccwpck_require__(822);
|
||||
|
||||
const {
|
||||
REMOTE_HOST, REMOTE_USER,
|
||||
REMOTE_PORT, SSH_PRIVATE_KEY, DEPLOY_KEY_NAME,
|
||||
SOURCE, TARGET, ARGS, EXCLUDE,
|
||||
GITHUB_WORKSPACE
|
||||
} = __webpack_require__(659);
|
||||
} = __nccwpck_require__(229);
|
||||
|
||||
const defaultOptions = {
|
||||
ssh: true,
|
||||
@@ -658,75 +739,8 @@ const run = () => {
|
||||
|
||||
run();
|
||||
|
||||
})();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 677:
|
||||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(243);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 735:
|
||||
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||
|
||||
const { sync: commandExists } = __webpack_require__(677);
|
||||
const { get: nodeCmd } = __webpack_require__(428);
|
||||
|
||||
const validateRsync = (callback = () => {}) => {
|
||||
const rsyncCli = commandExists('rsync');
|
||||
|
||||
if (!rsyncCli) {
|
||||
nodeCmd(
|
||||
'sudo apt-get --no-install-recommends install rsync',
|
||||
(err, data, stderr) => {
|
||||
if (err) {
|
||||
console.log('⚠️ [CLI] Rsync installation failed. Aborting ... ', err.message);
|
||||
process.abort();
|
||||
} else {
|
||||
console.log('✅ [CLI] Rsync installed. \n', data, stderr);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const validateInputs = (inputs) => {
|
||||
const inputKeys = Object.keys(inputs);
|
||||
const validInputs = inputKeys.filter((inputKey) => {
|
||||
const inputValue = inputs[inputKey];
|
||||
|
||||
if (!inputValue) {
|
||||
console.error(`⚠️ [INPUTS] ${inputKey} is mandatory`);
|
||||
}
|
||||
|
||||
return inputValue;
|
||||
});
|
||||
|
||||
if (validInputs.length !== inputKeys.length) {
|
||||
console.error('⚠️ [INPUTS] Inputs not valid, aborting ...');
|
||||
process.abort();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
validateRsync,
|
||||
validateInputs
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 747:
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = require("fs");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
29
docs/CHANGELOG.md
Normal file
29
docs/CHANGELOG.md
Normal file
@@ -0,0 +1,29 @@
|
||||
## [2.2.2](https://github.com/easingthemes/ssh-deploy/compare/v2.2.1...v2.2.2) (2021-05-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* codeql build ([5e456a4](https://github.com/easingthemes/ssh-deploy/commit/5e456a475a15096d08ccd2aff2734b3f1250b308))
|
||||
|
||||
## [2.2.1](https://github.com/easingthemes/ssh-deploy/compare/v2.2.0...v2.2.1) (2021-05-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add package json auto updates ([ce56d75](https://github.com/easingthemes/ssh-deploy/commit/ce56d75fc1b62a99d72ffba70dcb24fcc3b6b3df))
|
||||
|
||||
# [2.2.0](https://github.com/easingthemes/ssh-deploy/compare/v2.1.7...v2.2.0) (2021-05-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* only=prod package json ([95f4dc8](https://github.com/easingthemes/ssh-deploy/commit/95f4dc8069045c1f5f726e00cb519b46e4f14267))
|
||||
* replace i with ci ([50d1f57](https://github.com/easingthemes/ssh-deploy/commit/50d1f576f95c0d7e8ce99fb1b2ab68b2594973e5))
|
||||
* update ncc ([20a0cae](https://github.com/easingthemes/ssh-deploy/commit/20a0cae1ae81bcc430507363e800342976307a81))
|
||||
* update plugins ([b2adc00](https://github.com/easingthemes/ssh-deploy/commit/b2adc00c92f129aef41ae46441411c2bebc0dbe4))
|
||||
* update plugins ([a50a999](https://github.com/easingthemes/ssh-deploy/commit/a50a999528b503846cc7fdf26210f710bd95565a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add semantic-release-action ([ac3c9b5](https://github.com/easingthemes/ssh-deploy/commit/ac3c9b51d5cb52f4add40e2fc2dcc5e970153afc))
|
3499
package-lock.json
generated
3499
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@@ -1,18 +1,19 @@
|
||||
{
|
||||
"name": "ssh-deploy",
|
||||
"version": "2.1.5",
|
||||
"description": "This GitHub Action deploys specific directory from `GITHUB_WORKSPACE` to a folder on a server via rsync over ssh.",
|
||||
"version": "2.1.9",
|
||||
"private": true,
|
||||
"description": "Fast NodeJS action to deploy specific directory from `GITHUB_WORKSPACE` to a server via rsync over ssh.",
|
||||
"main": "src/index.js",
|
||||
"dependencies": {
|
||||
"command-exists": "1.2.8",
|
||||
"node-cmd": "3.0.0",
|
||||
"command-exists": "1.2.9",
|
||||
"node-cmd": "4.0.0",
|
||||
"rsyncwrapper": "3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@zeit/ncc": "^0.20.5",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-airbnb-base": "^14.1.0",
|
||||
"eslint-plugin-import": "^2.20.2"
|
||||
"@vercel/ncc": "^0.28.6",
|
||||
"eslint": "^7.27.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-plugin-import": "^2.23.3"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run lint && ncc build ./src/index.js -o dist",
|
||||
@@ -29,7 +30,7 @@
|
||||
"rsync"
|
||||
],
|
||||
"author": "Dragan Filipovic",
|
||||
"license": "ISC",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/easingthemes/ssh-deploy/issues"
|
||||
},
|
||||
|
Reference in New Issue
Block a user