Browse Source

添加基于CentOS的操作系统与服务的安装文档。

sybotan 5 years ago
parent
commit
f7a6d32f59
37 changed files with 556 additions and 12 deletions
  1. 118 2
      docs/.vuepress/config.js
  2. BIN
      docs/.vuepress/public/assets/img/logo.png
  3. 3 10
      docs/README.md
  4. 3 0
      docs/deploy/README.md
  5. 9 0
      docs/deploy/centos/README.md
  6. 4 0
      docs/deploy/centos/app-server/README.md
  7. 1 0
      docs/deploy/centos/os/README.md
  8. 32 0
      docs/deploy/centos/os/cmd.md
  9. 18 0
      docs/deploy/centos/os/config.md
  10. BIN
      docs/deploy/centos/os/img/centos7_001.png
  11. BIN
      docs/deploy/centos/os/img/centos7_002.png
  12. BIN
      docs/deploy/centos/os/img/centos7_003.png
  13. BIN
      docs/deploy/centos/os/img/centos7_004.png
  14. BIN
      docs/deploy/centos/os/img/centos7_005.png
  15. BIN
      docs/deploy/centos/os/img/centos7_006.png
  16. BIN
      docs/deploy/centos/os/img/centos7_007.png
  17. BIN
      docs/deploy/centos/os/img/centos7_008.png
  18. BIN
      docs/deploy/centos/os/img/centos7_009.png
  19. BIN
      docs/deploy/centos/os/img/centos_net_001.png
  20. 75 0
      docs/deploy/centos/os/install.md
  21. 6 0
      docs/deploy/centos/server/README.md
  22. BIN
      docs/deploy/centos/server/img/postgresql_001.png
  23. BIN
      docs/deploy/centos/server/img/postgresql_002.png
  24. BIN
      docs/deploy/centos/server/img/tomcat_config_001.png
  25. BIN
      docs/deploy/centos/server/img/tomcat_config_002.png
  26. BIN
      docs/deploy/centos/server/img/tomcat_config_login.png
  27. BIN
      docs/deploy/centos/server/img/tomcat_manager.jpg
  28. BIN
      docs/deploy/centos/server/img/tomcat_manager_001.jpg
  29. 26 0
      docs/deploy/centos/server/jdk.md
  30. 1 0
      docs/deploy/centos/server/mariadb.md
  31. 46 0
      docs/deploy/centos/server/nginx.md
  32. 61 0
      docs/deploy/centos/server/postgresql.md
  33. 26 0
      docs/deploy/centos/server/python.md
  34. 54 0
      docs/deploy/centos/server/tomcat.md
  35. 1 0
      docs/deploy/windows/README.md
  36. 19 0
      package.json
  37. 53 0
      publish.js

+ 118 - 2
docs/.vuepress/config.js

@@ -1,4 +1,120 @@
 module.exports = {
-    title: "数字化交付参考文档1",
-    description: "上格云数字化交付参考文档1",
+    title: "数字化交付参考文档",
+    description: "上格云数字化交付参考文档",
+    base: "/docs/",
+    // plugins: ["@vuepress/last-updated"],
+    plugins: ['@vuepress/back-to-top'],
+    markdown: {
+        lineNumbers: true
+    },
+    themeConfig: {
+        logo: "/assets/img/logo.png",
+        nav: [
+            {text: "首页", link: "/"},
+            {text: "安装部署", link: "/deploy/"},
+            {
+                text: "开发文档",
+                items: [
+                    {
+                        text: "后台开发",
+                        items: [
+                            {text: "数据中心", link: "/datacenter/"},
+                            {text: "模型管理", link: "/module/"}
+                        ]
+                    },
+                    {
+                        text: "Revit二开",
+                        items: [
+                            {text: "服务端Revit", link: "/revit/datacenter/"},
+                            {text: "Revit插件", link: "/revit/module/"}
+                        ]
+                    },
+                    {
+                        text: "Web开发",
+                        items: [
+                            { text: "Sybotan Graphy 引擎", link: "http://docs.sybotan.com:88/api/web/graphy/" }
+                        ]
+                    },
+                    {
+                        text: "移动端开发",
+                        items: [
+                            { text: "Sybotan Graphy 引擎", link: "http://docs.sybotan.com:88/api/web/graphy/" }
+                        ]
+                    }
+                ]
+            },
+            {
+                text: "API参考",
+                items: [
+                    {
+                        text: "后台开发",
+                        items: [
+                            { text: "Sybotan Graphy 引擎", link: "http://docs.sybotan.com:88/api/web/graphy/" }
+                        ]
+                    },
+                    {
+                        text: "Web开发",
+                        items: [
+                            { text: "Sybotan Graphy 引擎", link: "http://docs.sybotan.com:88/api/web/graphy/" }
+                        ]
+                    },
+                    {
+                        text: "移动端开发",
+                        items: [
+                            { text: "Sybotan Graphy 引擎", link: "http://docs.sybotan.com:88/api/web/graphy/" }
+                        ]
+                    }
+                ]
+            },
+            {text: "编码风格", link: "/style/"}
+        ],
+        displayAllHeaders: true,
+        sidebarDepth: 2,
+        sidebar: {
+            "/deploy/": [
+                ["/deploy/", "安装部署"],
+                {
+                    title: "基于 CentOS 安装",
+                    path: "/deploy/centos/",
+                    children: [
+                        {
+                            title: "操作系统",
+                            path: "/deploy/centos/os/",
+                            children: [
+                                ["/deploy/centos/os/install", "安装系统"],
+                                ["/deploy/centos/os/config", "配置系统"],
+                                ["/deploy/centos/os/cmd", "常用命令"]
+                            ]
+                        },
+                        {
+                            title: "基础服务",
+                            path: "/deploy/centos/server/",
+                            children: [
+                                ["/deploy/centos/server/nginx", "Nginx"],
+                                ["/deploy/centos/server/jdk", "JDK"],
+                                ["/deploy/centos/server/tomcat", "Tomcat"],
+                                ["/deploy/centos/server/python", "Python"],
+                                ["/deploy/centos/server/postgresql", "PostgreSQL"],
+                            ]
+                        },
+                        {
+                            title: "应用服务",
+                            path: "/deploy/centos/app-server/",
+                            children: [
+                                // ["/deploy/centos/app-server/datacenter", "数据中心"],
+                                // ["/deploy/centos/app-server/pointconfig", "点位配置"],
+                                // ["/deploy/centos/app-server/ibms", "慧运营后台"],
+                                // ["/deploy/centos/app-server/scanbuilding", "扫楼后台"]
+                            ]
+                        }
+                    ]
+                },
+                {
+                    title: "基于 Windows 安装",
+                    path: "/deploy/windows/",
+                    children: []
+                }
+            ]
+        }
+    }
 };

BIN
docs/.vuepress/public/assets/img/logo.png


+ 3 - 10
docs/README.md

@@ -1,19 +1,12 @@
 ---
 home: true
 heroImage: /assets/img/logo.png
-heroText: 数字化交付参考文档
+heroText: 上格云
 tagline: 上格云数字化交付参考文档
 actionText: 快速上手 →
 actionLink: /zh/guide/
-features:
-- title: 简洁至上
-  details: 以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作。
-- title: Vue驱动
-  details: 享受 Vue + webpack 的开发体验,在 Markdown 中使用 Vue 组件,同时可以使用 Vue 来开发自定义主题。
-- title: 高性能
-  details: VuePress 为每个页面预渲染生成静态的 HTML,同时在页面被加载的时候,将作为 SPA 运行。
 
-footer: MIT Licensed | Copyright © 2018-present Evan You
+footer: MIT Licensed | Copyright © 2016-present 北京上格云技术有限公司
 ---
 
-# Hello Daoyu!
+# 参考文档

+ 3 - 0
docs/deploy/README.md

@@ -0,0 +1,3 @@
+# 安装发布教程
+## 基于 CentOS 系统安装
+## 基于 Windows 系统安装

+ 9 - 0
docs/deploy/centos/README.md

@@ -0,0 +1,9 @@
+# 基于 CentOS 系统安装
+## 基础服务
+### Nginx
+### JDK
+### Tomcat
+### Python
+### PostgreSQL
+
+## 应用服务

+ 4 - 0
docs/deploy/centos/app-server/README.md

@@ -0,0 +1,4 @@
+# 应用服务
+## datacenter
+## scanbuilding
+## ibms

+ 1 - 0
docs/deploy/centos/os/README.md

@@ -0,0 +1 @@
+# CentOS

+ 32 - 0
docs/deploy/centos/os/cmd.md

@@ -0,0 +1,32 @@
+# 常用命令
+## 文件系统
+### 切换路径 
+cd
+### 显示当前路径
+pwd
+
+### 创建文件夹
+mkdir
+### 删除文件/文件夹
+rm
+### 复制文件/文件夹
+
+### 移动文件/文件夹
+### 编辑文件
+### 查询文件内容
+### sudo 操作
+### 切换用户
+### 权限
+### 所有者
+
+### 服务相关
+#### 启动服务
+#### 停止服务
+#### 开机重启
+
+## 软件管理
+
+## 访问远程主机
+### 远程登录
+### 远程复制
+### 文件下载

+ 18 - 0
docs/deploy/centos/os/config.md

@@ -0,0 +1,18 @@
+# 配置
+## 配置 hosts文件
+
+## 挂载扩展盘
+
+查看磁盘的 UUID
+```
+[root@sybotan ~]# blkid
+/dev/vda1: UUID="87ba1103-a0d7-49ef-a8ae-6ce1d3fd2453" TYPE="ext4" 
+/dev/vdb1: UUID="ee865766-b0d0-4518-8969-49e432f23838" TYPE="ext4" 
+```
+
+编辑文件“/etc/fstab”,将扩展盘挂载到“/opt”。
+```
+UUID=ee865766-b0d0-4518-8969-49e432f23838 /opt                    ext4    defaults        1 1
+```
+
+注:在实际的配置中, UUID 的值要改为实际挂载盘的 UUID 。

BIN
docs/deploy/centos/os/img/centos7_001.png


BIN
docs/deploy/centos/os/img/centos7_002.png


BIN
docs/deploy/centos/os/img/centos7_003.png


BIN
docs/deploy/centos/os/img/centos7_004.png


BIN
docs/deploy/centos/os/img/centos7_005.png


BIN
docs/deploy/centos/os/img/centos7_006.png


BIN
docs/deploy/centos/os/img/centos7_007.png


BIN
docs/deploy/centos/os/img/centos7_008.png


BIN
docs/deploy/centos/os/img/centos7_009.png


BIN
docs/deploy/centos/os/img/centos_net_001.png


+ 75 - 0
docs/deploy/centos/os/install.md

@@ -0,0 +1,75 @@
+# CentOS
+
+## 下载
+
+官网地址:https://www.centos.org
+
+下载页面:https://www.centos.org/download/
+
+国内下载地址:http://mirrors.nju.edu.cn/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso
+
+## 安装
+
+将安装盘装入机器,设置从光盘启动。(虚拟机可以加载 iso 光盘镜像文件到光驱中)
+
+![安装CentOS7 001](./img/centos7_001.png)
+
+选择“Install CentOS 7”,按回车键安装 CentOS 7;
+
+![安装CentOS7 002](./img/centos7_002.png)
+
+“您在安装过程中想使用哪种语言?”使用“中文”->“简体中文(中国)”。点击“继续”按钮开始安装设置;
+
+![安装CentOS7 003](./img/centos7_003.png)
+
+点击“安装位置”,设置将操作系统安装到哪个磁盘;
+
+![安装CentOS7 004](./img/centos7_004.png)
+
+选择要安装CentOS的磁盘,然后点击“完成”按钮返回安装摘要窗口。
+
+![安装CentOS7 005](./img/centos7_005.png)
+
+点击“开始安装”按钮开始安装;
+
+![安装CentOS7 006](./img/centos7_006.png)
+
+点击“ROOT 密码”设置root用户密码;
+
+![安装CentOS7 007](./img/centos7_007.png)
+
+在“Root 密码”输入框,输入root用户密码。在“确认”输入框,输入相同的root用户密码。点击“完成”按钮,完成root用户密码的设置;
+
+![安装CentOS7 008](./img/centos7_008.png)
+
+点击“重启”按钮重启系统;重启后进入如下的登录界面。
+
+![安装CentOS7 009](./img/centos7_009.png)
+
+安装完成。
+
+## 配置网络
+### 开机时启动网络
+CentOS 安装完成后,默认网络是关闭状态。要使用网络必须打开网络设置。编辑网络配置文件“/etc/sysconfig/network-scripts/ifcfg-ens33”。
+
+![启动网络](./img/centos_net_001.png)
+
+将“ONBOOT=no”改为“ONBOOT=yes”。保存文件。
+
+重新启动网络。
+
+```
+[root@localhost ~] systemctl restart network
+```
+
+### 配置静态 IP 地址
+CentOS 
+
+## 安装必备工具
+
+CentOS 安装完成后,默认没有安装 ifconfig, wget 等命令。使用 yum 安装这些必备工具。
+
+```
+[root@localhost ~] yum install net-tools
+[root@localhost ~] yum install wget
+```

+ 6 - 0
docs/deploy/centos/server/README.md

@@ -0,0 +1,6 @@
+# 基础服务
+## Nginx
+## JDK
+## Tomcat
+## Python
+## PostgreSQL

BIN
docs/deploy/centos/server/img/postgresql_001.png


BIN
docs/deploy/centos/server/img/postgresql_002.png


BIN
docs/deploy/centos/server/img/tomcat_config_001.png


BIN
docs/deploy/centos/server/img/tomcat_config_002.png


BIN
docs/deploy/centos/server/img/tomcat_config_login.png


BIN
docs/deploy/centos/server/img/tomcat_manager.jpg


BIN
docs/deploy/centos/server/img/tomcat_manager_001.jpg


+ 26 - 0
docs/deploy/centos/server/jdk.md

@@ -0,0 +1,26 @@
+# JDK
+## 下载
+官网地址:https://www.oracle.com
+
+下载页面:https://www.oracle.com/technetwork/java/javase/downloads/index.html
+
+下载地址:https://download.oracle.com/otn/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.rpm
+
+使用 wget 下载 JDK
+
+```
+[root@localhost ~] wget https://download.oracle.com/otn/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.rpm
+```
+
+## 安装
+
+使用 rpm 命令安装 JDK-8u181 。
+
+```
+[root@localhost ~] rpm -ivh jdk-8u181-linux-x64.rpm
+```
+
+### 解决 Tomcat 启动慢问题
+
+编辑文件“/usr/java/jdk1.8.0_181-amd64/jre/lib/security/java.security”。
+将“securerandom.source=file:/dev/random”改为“securerandom.source=file:/dev/urandom”。

+ 1 - 0
docs/deploy/centos/server/mariadb.md

@@ -0,0 +1 @@
+# 安装MariaDB

+ 46 - 0
docs/deploy/centos/server/nginx.md

@@ -0,0 +1,46 @@
+# Nginx
+## 安装
+执行如焉命令安装Nginx源。
+```
+[root@localhost ~] rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
+```
+
+使用 yum 命令安装 Ngnix
+
+```
+[root@localhost ~] yum install nginx
+```
+
+配置开机启动与启动
+
+```
+[root@localhost ~] systemctl enable nginx
+[root@localhost ~] systemctl start nginx
+```
+
+## 配置
+### 常用 Nginx 命令
+启动nginx
+
+```
+[root@localhost ~] nginx
+```
+
+测试 Nginx 配置是否正确
+```
+[root@localhost ~] nginx -t
+```
+
+重启 Nginx
+```
+[root@localhost ~] nginx -s reload
+```
+
+### Nginx的默认路径
+* Nginx配置路径:/etc/nginx/
+* PID目录:/var/run/nginx.pid
+* 错误日志:/var/log/nginx/error.log
+* 访问日志:/var/log/nginx/access.log
+* 默认站点目录:/usr/share/nginx/html
+
+### Nginx 配置

+ 61 - 0
docs/deploy/centos/server/postgresql.md

@@ -0,0 +1,61 @@
+# PostgreSQL
+## 下载
+官网地址:[https://www.postgresql.org/](https://www.postgresql.org/)
+
+下载地页面:[https://www.postgresql.org/download/linux/redhat/](https://www.postgresql.org/download/linux/redhat/)
+
+## 安装
+
+使用yum命令添加PostgreSQL软件源。
+
+```
+[root@localhost ~] yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+```
+
+使用yum命令安装PostgreSQL。
+
+```
+[root@localhost ~] yum install postgresql12
+[root@localhost ~] yum install postgresql12-server
+[root@localhost ~] yum install postgresql12-contrib
+```
+
+初始化数据库。
+
+```
+[root@localhost ~] /usr/pgsql-12/bin/postgresql-12-setup initdb
+```
+
+配置开机启动与启动
+```
+[root@localhost ~] systemctl enable postgresql-12
+[root@localhost ~] systemctl start postgresql-12
+```
+
+## 配置远程访问
+### 修改密码
+首先,切换到postgres用户。然后执行修改用户密码SQL语句。其中“postgres”为要修改密码的用户,“123456”为用户的密码。
+```
+[root@localhost ~] su - postgres
+bash-4.2$ psql -c "alter user postgres with password '123456'"
+```
+
+### 修改配置文件
+
+打开并编辑文件“/var/lib/pgsql/12/data/postgresql.conf”。将“#listen_addresses = 'localhost'”改为“listen_addresses = '*'”
+![PostgreSQL远程连接配置](./img/postgresql_001.png)
+
+打开并编辑文件“/var/lib/pgsql/12/data/pg_hba.conf”。在文件的末尾添加“host  all  all  0.0.0.0/0  md5”。
+![PostgreSQL远程连接配置](./img/postgresql_002.png)
+
+### 安装Python3支持包
+如果不需要数据库Python3支持,则忽略该步骤。
+
+```
+[root@localhost ~] yum install postgresql12-plpython3
+```
+
+要使用python扩展,需要打开数据库,执行如下SQL语句。
+``` sql
+CREATE extension plpython3u;
+```

+ 26 - 0
docs/deploy/centos/server/python.md

@@ -0,0 +1,26 @@
+# Python
+
+如果系统已经安装Python3,或不需要数据库支持Python3,则跳过该安装过程。
+
+## 安装
+
+CentOS7默认软件源中没有Python3,要安装Python3需首先安装epel软件源。
+```
+[root@localhost ~] yum install epel-release
+```
+
+使用 yum 安装 Python3
+
+```
+[root@localhost ~] yum install python36
+```
+
+### 安装 Python 依赖库
+使用 pip3 命令安装项目需要用到的 Python 依赖库
+```
+[root@localhost ~] pip3 install vg
+[root@localhost ~] pip3 install numpy
+[root@localhost ~] pip3 install matplotlib
+[root@localhost ~] pip3 install shapely
+[root@localhost ~] pip3 install networkx
+```

+ 54 - 0
docs/deploy/centos/server/tomcat.md

@@ -0,0 +1,54 @@
+# Tomcat
+## 下载
+
+官网地址:[http://tomcat.apache.org](http://tomcat.apache.org)
+
+下载地址:[https://tomcat.apache.org/download-90.cgi](https://tomcat.apache.org/download-90.cgi)
+
+下载地址:[http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.27/bin/apache-tomcat-9.0.27.tar.gz](http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.27/bin/apache-tomcat-9.0.27.tar.gz)
+
+使用 wget 命令下载 Tomcat9 。
+```
+[root@localhost ~] wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.27/bin/apache-tomcat-9.0.27.tar.gz
+```
+
+## 安装
+```
+[root@localhost ~] tar xvf apache-tomcat-9.0.27.tar.gz -C /opt
+```
+
+## 配置
+### 管理员密码
+
+打开并编辑配置文件“/opt/tomcat9/conf/tomcat-users.xml”,在“</tomcat-users>”之前添加入下配置信息。
+
+``` xml
+<role rolename="manager-gui"/>
+<role rolename="manager-script"/>
+<role rolename="manager-jmx"/>
+<role rolename="manager-status"/>
+<user username="tomcat" password="123456" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
+```
+
+配置截图如下:
+
+![远程访问](./img/tomcat_config_001.png)
+
+manager默认只允许本地访问,要支持远程访问必须修改远程访问配置。打开并编辑配置文件“/opt/tomcat9/webapps/manager/META-INF/context.xml”。修改允许远程访问的PC的地址为“\d+\.\d+\.\d+\.\d+”。
+
+![远程访问](./img/tomcat_config_002.png)
+
+### 测试远程配置
+打开浏览器在浏览器地址栏输入Tomcat服务器地址与,“http://服务器地址:8080”:
+
+![Tomcat初始页面](./img/tomcat_manager.jpg)
+
+点击“Manager App”按钮,管理服务器上部署的应用。
+
+![远程访问](./img/tomcat_config_login.png)
+
+输入在配置文件“tomcat-users.xml”中配置的用户名“tomcat”,密码“123456”,点击“登录”按钮。
+
+![Tomcat Web应用管事管理器](./img/tomcat_manager_001.jpg)
+
+## 常见问题处理

+ 1 - 0
docs/deploy/windows/README.md

@@ -0,0 +1 @@
+# 基于 Windows 系统安装

+ 19 - 0
package.json

@@ -0,0 +1,19 @@
+{
+  "remote": {
+    "host": "192.168.20.236",
+    "path": "/opt/tomcat9/webapps/docs",
+    "user": "root",
+    "password": "saga",
+    "local": "docs/.vuepress/dist"
+  },
+  "scripts": {
+    "dev": "vuepress dev docs",
+    "build": "vuepress build docs",
+    "publish": "node publish.js"
+  },
+  "devDependencies": {
+    "node-ssh": "^6.0.0",
+    "vuepress": "^1.2.0",
+    "@vuepress/plugin-back-to-top": "^1.2.0"
+  }
+}

+ 53 - 0
publish.js

@@ -0,0 +1,53 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *               iFHS7.
+ *              ;BBMBMBMc                  rZMBMBR              BMB
+ *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
+ *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
+ *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
+ *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
+ *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
+ *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
+ *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
+ *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
+ *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
+ *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
+ *         i0BM: SWKHKGO  MBDv
+ *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2019.  斯伯坦机器人
+ *              ,  XMW  ..
+ *                  r                                                                     All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+const Client = require("node-ssh");
+const ssh = new Client();
+
+ssh.connect({
+    host: process.env.npm_package_remote_host,
+    port: "22",
+    username: process.env.npm_package_remote_user,
+    password: process.env.npm_package_remote_password
+}).then(() => {
+    const failedList = [];
+    ssh.putDirectory(
+        process.env.npm_package_remote_local,
+        process.env.npm_package_remote_path,
+        {
+            recursive: true,
+            concurrency: 1,
+            tick: function(localPath, remotePath, error) {
+                if (error) {
+                    failedList.push(localPath);
+                }
+            }
+        }
+    ).then(status => {
+        if (failedList.length > 0) {
+            console.log("failed transfers", failedList.join(", "));
+        } else {
+            console.log(status ? "发布成功" : "发布失败");
+        }
+    });
+});