You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

sftploy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sftploy

A simple (CLI) tool to deploy stuff via SFTP

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
166
0.61%
Maintainers
1
Weekly downloads
 
Created
Source

SFTPloy

A simple (CLI) tool to deploy stuff via SFTP

Build Status Dependency Status Dependency Status

(Check out ftploy for FTP deployments.)

Usage

npm install --save-dev sftploy
var sftploy = require('sftploy');

sftploy({
  username: 'john',
  password: 'abc123',
  privateKey: './id_rsa'
  host: 'example.com',
  port: 22,
  localRoot: './build',
  remoteRoot: '/www/example.com/'
  exclude: [
    '.git'
  ]
}).then(function () {
  console.log('Deployment successful.');
}).catch(function (error) {
  console.error('Deployment failed.', error);
});

CLI

npm install -g sftploy
$ sftploy

The following options may be stored within a sftploy.json file in the root of your project or passed as parameters or environment variables (prefixed using sftploy_). For example, your username and password may be provided in the following three ways.

sftploy.json file

{
  "username": "john",
  "password": "abc123"
}

Parameters

$ sftploy --username="john" --password="abc123"

Environment variables

$ SFTPLOY_USERNAME="john" SFTPLOY_PASSWORD="abc123" sftploy

Options

username

The SFTP username.

password

The SFTP password. In case no password is provided, the CLI will prompt you for it.

privateKey

The SSH private key.

host

The SFTP host.

port

The SFTP port.

Default: 22

files

An array of files or a glob pattern to select files to upload.

Default: **/* (= glob pattern for all files and directories within the provided localRoot; see below)

localRoot

The local directory whose contents SFTPloy will upload.

Default: process.cwd() (= the directory you’re running the CLI in)

remoteRoot

The remote directory where SFTPloy will upload the contents to.

Default: /

exclude

Certain files (matching the respective glob patterns) that shall be ignored by SFTPloy. In most cases, you may want to exclude your .git directory or directories like node_modules.

If you’re using an array of files instead of an glob pattern within the files option, exclude will be ignored.

Examples

$ sftploy --exclude=*.jpg --exclude=*.png --exclude=node_modules/**/*
{
  "exclude": [
    "*.jpg",
    "*.png"
  ]
}

Changelog

  • 0.0.3
    • Include dot files during deployments
  • 0.0.2
    • Add shebang
    • Update dependencies
  • 0.0.1
    • Initial version

License

Copyright (c) 2016 Thomas Rasshofer
Licensed under the MIT license.

See LICENSE for more info.

Contributors

Keywords

sftploy

FAQs

Package last updated on 23 Apr 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