New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lp-deployer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lp-deployer

Run pre, post, local and remote scripts; and upload files (creating directories if necessary) if you need to. All through SSH

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

lp-deployer

Run pre, post, local and remote scripts; and upload files (creating directories if necessary) if you need to. All through SSH

Installation

yarn global add lp-deployer

Usage

lpd configfile.json

where configfile.json is the configuration file. Or

lpd

and it will look for a file called lp-deployer.json in the current directory with the configuration.

Configuration

The configuration file should be like this:

{
  "server": "svrstaging",
  "commands": {
    "pre": [
      { "location": "local", "script": "yarn run build-prod" },
      { "location": "remote", "script": "systemctl stop yourawesomeapp_service", "continueOnError": true }
    ],
    "post": [
      { "location": "remote", "script": "yarn --prod" },
      { "location": "remote", "script": "systemctl start yourawesomeapp_service" },
      { "location": "local", "script": "knex migrate:latest --env={{{knexEnvironment}}}" }
    ]
  },
  "upload": {
    "directory": "/opt/yourapp",
    "items": [
      "app/routes",
      "app/models",
      "public",
      "config.js",
      "package.json",
      "server.js"
    ]
  }
}

this means:

server

The target server to upload files and / or run remote commands.

commands

Here you have two groups: pre and post. The pre group will be run before uploading files to the target, and the post group after. In each command you can specify if it has to be run locally in the computer from where you're deploying, or remotely in the target server.

continueOnError

By default this is false, and will halt the whole process if this command fails. When you set it to true you're saying that you want to continue with the other commands even if this one fails.

upload

directory

Where you want to copy the files and directories to.

items

A list of files and directories that you want to upload. If you specify a file it will be uploaded, if it's a directory it'll upload all files in it. The deployer will create all missing remote directories needed to complete this task.

But... What if I have more than one environment to deploy to?

Easy! Have many configuration files, one for each environment.

You could use the lpd-deployer.json file as your default one, and for example lpd-deployer-staging.json for staging, lpd-deployer-prod.json for production and so on.

Credits

@luispablo

FAQs

Package last updated on 20 Oct 2017

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