GithubHelp home page GithubHelp logo

gulp-sftp's Introduction

gulp-sftp Build Status

Upload files via SSH

Useful for uploading and deploying things via sftp. Right now this plugin just uploads everything. Caching and hash comparison are two TODO items.

NPM

Install

$ npm install --save-dev gulp-sftp

Usage

var gulp = require('gulp');
var sftp = require('gulp-sftp');

gulp.task('default', function () {
	return gulp.src('src/*')
		.pipe(sftp({
			host: 'website.com',
			user: 'johndoe',
			pass: '1234'
		}));
});

API

sftp(options)

options.host

Required
Type: String

options.port

Type: Number
Default: 22

options.user

Type: String
Default: 'anonymous'

options.pass

Type: String
Default: null

If this option is not set, gulp-sftp assumes the user is using private key authentication and will default to using keys at the following locations:

~/.ssh/id_dsa and /.ssh/id_rsa

If you intend to use anonymous login, use the value '@anonymous'.

options.remotePath

Type: String
Default: '/'

The remote path to upload too. This path should exist, though the child directories that house your files do not need to.

options.key

type String or Object Default: null

A key file location. If an object, please use the format {location:'/path/to/file',passphrase:'secretphrase'}

options.passphrase

type String Default: null

A passphrase for secret key authentication. Leave blank if your key does not need a passphrase.

options.keyContents

type String Default: null

If you wish to pass the key directly through gulp, you can do so by setting it to options.keyContents.

options.auth

type String Default: null

An identifier to access authentication information from .ftppass see Authentication for more information.

##Authentication

For better security, save authentication data in a json formatted file named .ftppass

var gulp = require('gulp');
var sftp = require('gulp-sftp');

gulp.task('default', function () {
	return gulp.src('src/*')
		.pipe(sftp({
			host: 'website.com',			
			auth: 'keyMain'
		}));
});

.ftppass

{
  "keyMain": {
    "user": "username1",
    "pass": "password1"
  },  
  "privateKey": {    
    "user": "username"
  },
  "privateKeyEncrypted": {    
    "user": "username",
    "passphrase": "passphrase1"
  },
  "privateKeyCustom": {    
    "user": "username",
    "passphrase": "passphrase1",
    "keyLocation": "/full/path/to/key"
  }
}

License

MIT

gulp-sftp's People

Contributors

gtg092x avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.