vfe-deploy

2.1.8 • Public • Published

vfe-deploy

npm version

vfe deploy module for deploying files to remote server.

API

vdeploy(options, callback)

Deploy files to remote server.

Return: Promise

Options:

  • src <String|Array> Likes gulp.src(), specified files those need to deploy. See detail
  • base The folder relative to the cwd. This is used to determine the file names. Can also be a function that takes in a file and returns a folder path. See detail.
  • host which remote server to deploy
  • path what path of remote server to deploy

Noti: Root of diretrory should not naming "packages", otherwise result in error

  • proxy <Boolean|Object> optional, if remote server can't not access directly, using vfe server, params:

    • server Hostname of vfe server, path and host, without protocal, default "vfe.oa.com"
    • app_id optional, specified the app_id that created by vfe server, default "_deploy"

Example:

    var vdeploy = require('vfe-deploy')

    vdeploy({
        src: ['index.js', 'views'],
        host: "10.xx.xx.x:8xxx",
        path: "/data/user/tmp/"
    }, function (err) {
        err && console.error('Error', err)
    })

vdeploy.upload(options, callback)

Upload files to vfe server.

Return: Promise

Options:

  • src <String|Array> Likes gulp.src(), specified files those need to upload
  • server which remote server to upload
  • app_id appid that created by vfe server
  • path what path of remote server to upload

Example:

    var vdeploy = require('vfe-deploy')

    vdeploy.upload({
        src: ['index.js', 'views'],
        server: "10.xx.xx.x:8xxx",
        app_id: 'xxxx',
        path: "/"
    }, function (err) {
        err && console.error('Error', err)
    })

vdeploy.untar(options, callback)

Extract file of remote server.

Return: Promise

Options:

  • host <String> Server host of target file.
  • server <String> Proxy server host, default "vfe.oa.com". Optional
  • file <String> Absolute path of the un-tar file in remote server, could be tar.gz.
  • path <String> Extract tar file to the specified path, could be a relative path of file.
  • clean <Boolean> Whether remove tar file or not after extracting, default false. Optional

Example:

    var vdeploy = require('vfe-deploy')

    vdeploy.untar({
        host: "10.xx.xx.x:8xxx"
        server: "10.xx.xx.x:8xxx",
        file: "/absolute_path_to_tar_file",
        path: "./tmp"
    }).then(function () {
    })

Readme

Keywords

Package Sidebar

Install

npm i vfe-deploy

Weekly Downloads

1

Version

2.1.8

License

MIT

Last publish

Collaborators

  • switer