Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

debian-node-deploy

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debian-node-deploy

Unifying deployment tasks for my production server

  • 1.3.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

debian-node-deploy

Statements Branches Functions Lines

Deploying via vscode terminal

Here is a little module I made to simplify my deployments needs.

How to use

Install locally

npm install debian-node-deploy

or

yarn add debian-node-deploy

create the config file on your app root : deploy.config.json.

Here is a sample configuration for node apps:

{
  "envFile": ".env.production",
  "host": "my-production-server.org",
  "port": 22,
  "user": "myusername",
  "sshKey": "/path/to/ssh/key",
  "filesRestoryPath": "/where/to/send/the/archive/containing/the/code/to/deploy",
  "deployPath": "/where/to/deploy/the/app/on/production/server",
  "appPreStopCommands": [],
  "appPostStopCommands": [],
  "appPreStartCommands": [],
  "appPostStartCommands": []
}

For a single page applications, we need to specify two more properties:

{
  "envFile": ".env.production",
  "host": "my-production-server.org",
  "port": 22,
  "user": "myusername",
  "password": "my password",
  "sshKey": "/path/to/ssh/key",
  "filesRestoryPath": "/where/to/send/the/archive/containing/the/code/to/deploy",
  "deployPath": "/where/to/deploy/the/app/on/production/server",
  "websiteDomain": "mywebsite.com",
  "appPreStopCommands": [],
  "appPostStopCommands": [],
  "appPreStartCommands": [],
  "appPostStartCommands": []
}

The last four properties allow you to specify commands to execute before/after stopping the previous version in production and before/after starting the app.

Usage

You can trigger a deploy from cli or from code. There is two types of deployments available:

  • Node application
  • Single page application

cli

Here is an example to add a deploy task to the scripts section of package.json.

"scripts": {
   "deploynodeapp": "npm run build && deployNodeApp",
   "deployspa": "npm run build && deploySinglePageApp"
},

js

import deployNodeApp from "debian-node-deploy";

(async () => {
  await deployNodeApp(); // To deploy a node app
  await deployspa(); // or to deploy a spa
})();

FAQs

Package last updated on 10 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc