Skip to content

cyber-tools/ssh-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

针对h5的部署写了一个ssh客户端的部署脚本 目前测试环境和跳板机上均没有安装node.js 所以还是需要使用ssh-deploy test命令

Install

npm install @tianque/ssh-deploy  -g

Usage

生成deploy.config.js文件模板:

ssh-deploy config

部署命令:

ssh-deploy deploy

deploy.config.js

一下是公司测试环境的样例

const path=require("path");

module.exports={
  local: path.resolve(__dirname, "./dingNew/"),
  remote: "/home/admin/jsProject/dingNew",
  client: {
 	 	port: 11,
    host: "192.168.1.XXX",
    username: "XXXXX",
    password: "XXXXX"
  },
  beforeDeploy: async (client) => {
    // 部署之前运行的方法client是一个ssh的运行实例
    // console.log("beforeDeploy=>");
  },
  afterDeploy: async (client) => {
    // 部署之后运行的方法client是一个ssh的运行实例
    // console.log(afterDeploy);
  }
};

ssh运行实例请参考node-ssh文档

About

基于deploy.config.js部署到ssh终端

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published