emp-deploy
v2.0.0
Published
This module exports "configEmpDeploy" function that help you deploy easier.
Downloads
499
Readme
This module exports "configEmpDeploy" function that help you deploy easier.
methods
const { configEmpDeploy } = require('emp-deploy');
sshKeyPath
- string that represents the path of the private ssh keybuildsConfigArray
- an array of builds configs of this shape
export interface BuildConfig {
name: string;
buildPath: string;
serverPath: string;
url: string;
buildCommand: string;
host: string;
user: string;
}
example
import { configEmpDeploy } from 'emp-deploy';
const buildsConfig = [
{
name: 'PROD',
buildPath: './dist/prod',
serverPath: '/var/www/html/prod',
url: 'https://prod.com',
buildCommand: 'npm run build:prod && npm run purgecss',
host: 'root',
user: '192.168.0.1'
},
{
name: 'DEV',
buildPath: './dist/dev',
serverPath: '/var/www/html/dev',
url: 'https://dev.com',
buildCommand: 'npm run build:dev && npm run purgecss',
host: 'root',
user: '192.168.0.1'
}
];
const sshKeyPath = '../../../.ssh/id_rsa';
const runDeploy = await configEmpDeploy(sshKeyPath, buildsConfig);
runDeploy();
install
npm install emp-deploy --save-dev