Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sftp-deploy-cfs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sftp-deploy-cfs

自动部署到sftp协议服务器的方式

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

部署示例

1、初始化安装依赖包

执行命令:npm i --save-dev sftp-deploy-cfs

如已执行安装,后续不再用执行

2、配置

在build目录下添加deploy.js文件:

const sftpDeploy = require('sftp-deploy-cfs');  
sftpDeploy([
  {
    id: 'uat', // 唯一key
    name: 'UAT环境', // 别名
    host: '10.6.14.138', // 服务器ip
    port: 23, // 端口
    username: '****', // 服务器账号
    password: '****', // 服务器密码
    deployPath: 'dist', // 待部署的文件路径
    romotePath: '/host1' // 部署到服务器的文件路径
  },
  {
    id: 'sit',
    name: 'SIT环境',
    host: '10.6.14.138',
    port: 23,
    username: '****',
    password: '****',
    deployPath: 'dist',
    romotePath: '/host2'
  },
  ...
])

3、添加命令

在package.json文件中,scripts处添加:

"deploy": "node ./build/deploy",

4、执行命令

npm run deploy 或 npm run deploy uat

支持同时部署多台服务器(多个环境)

1、同时部署所有服务器

执行命令:npm run deploy

2、部署指定服务器

如:需要部署uat与sit环境

执行命令:npm run deploy uat,sit

命令解析

“uat,sit”为指定的服务器配置的id,多个用英文“,”分割

Keywords

FAQs

Package last updated on 22 Jul 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc