0.3.5 • Published 9 years ago

instadeploy v0.3.5

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

InstaDeploy

InstaDeploy Watches a folder and deploys using SFTP to multiple servers when changes are made. It is great for use in source deployment where a large number of hosts are at play.

Installation

npm install -g instadeploy

Usage

You can use either instadeploy or deploy cmd/terminal command.


Setup a new host

instadeploy add <unique_name> <host_ip> <username> <password> <unique_remote_path> <privateKey>

Ignore development folders (Ignore follows Minimatch's Glob Expressions Format)

instadeploy ignore ".gitignore" "node_modules/**" ".git/**" <pattern4> <pattern5> ...

Watch a folder (use -v or -verbosity to get accurate input)

instadeploy watch <local_path> <common_remote_path>

Remove a host

instadeploy remove <name>

Remove an ignore pattern

instadeploy allow <pattern>

API

Instance -> InstaDeploy(<Array:Objects>Hosts, Options) Example:

var fs = require('fs');
var InstaDeploy = require('instadeploy');
var Deployer = new InstaDeploy([
  { name: 'test', host: '127.0.0.1', port: 8085, username: 'root', password: 'test', path: 'uploads', privateKey: fs.readFileSync('/path/to/key') },
  { name: 'host2', host: '127.0.0.1', port: 8045, username: 'notroot', password: 'test2', path: 'test', privateKey: fs.readFileSync('/path/to/key2') }
], {
  ignore: ['node_modules\\**', '.gitignore']
})

Note: If a password is not provided the user will be prompted for it. To disable this pass a 'noprompt' attribute with every remote connection object that is passed to InstaDeploy.

Options

Events

  • attempt: (args-> \Host, \NoOfRetries) Emitted when a new connection attempt is made
  • connect: (args-> \Host, \NoOfRetries, \Handler) Emitted when a connection is made to one of the hosts
  • disconnect: (args-> \Host, \NoOfRetries, \Handler) Emitted when a connection is lost
  •   --------
  • uploadStarted: (\RelativePath, \AbsolutePath, \RemotePath) Emitted when a file has been queued for upload
  • uploaded: (args-> \RelativePath, \AbsolutePath) Emitted when an upload has successfully completed
  • ignored: (args-> \RelativePath, \AbsolutePath) Emitted when a file has been ignored
  • failed: (args-> \Error, \RelativePath, \AbsolutePath) Emitted when an upload has failed
  •   --------
  • start: (args-> \NumberOfItems) Emitted when a new batch is queued for upload
  • end: (args-> None) Emitted when all items of the batch have been uploaded

License

MIT © Schahriar SaffarShargh - Full License