🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@cloudbase/cli

Package Overview
Dependencies
Maintainers
2
Versions
579
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudbase/cli

## 安装

npmnpm
Version
0.0.1-beta.2
Version published
Weekly downloads
9.1K
12.33%
Maintainers
2
Weekly downloads
 
Created
Source

Cloudbase命令行工具

安装

npm install -g @cloudbase/cli

使用方法

tcb -h
# Usage: tcb [options] [command]
# 
# Options:
#   -V, --version            output the version number
#   -h, --help               output usage information
# 
# Commands:
#   deploy [options] [name]  执行完整的发布
#   build [name]             构建
#   upload [name]            上传
#   reload [name]            热重载
#   start [name]             启动
#   show <name>              查看状态

构建

tcb build

发布

tcb deploy

tcb.json

cli的配置文件

示例:

{
    "common": {
        "secretId": "xxxxxxxxxxxxxxxxxxxxxxxxx",
        "secretKey": "xxxxxxxxxxxxxxxxxx",
        "server": {
            "host": "1.2.3.4",
            "username": "root",
            "port": 22,
            "password": "xxxxxxxxxx"
        }
    },
    "deploys": [
        {
            "name": "websocket",
            "entry": "index.js",
            "type": "websocket",
            "config": {
                "distPath": "./dist",
                "remotePath": "/root/websocket/dist"
            }
        }
    ]
}

common

包含账号、服务器等通用信息

{
    "common": {
        "secretId": "xxxxxxxxxxxxxxxxxxxxxxxxx",
        "secretKey": "xxxxxxxxxxxxxxxxxx",
        "server": {
            "host": "1.2.3.4",
            "username": "root",
            "port": 22,
            "password": "xxxxxxxxxx"
        }
    }
    // ...
}

common.secretId

用户的腾讯云secretId

common.secretKey

用户的腾讯云secretKey

common.server

云主机信息

common.server.host

云主机 host

common.server.username

云主机用户名,默认为 root

common.server.port

云主机ssh端口号,默认为 22

common.server.password

云主机密码

deploys

数组,包含项目的发布配置

示例:

{
    "deploys": [
        // 云函数示例
        {
            "name": "add",
            "type": "function",
            "path": "./",
            "envId": "test-e48fe1"
        },

        // Node服务示例
        {
            "name": "app",
            "type": "node",
            "entry": "app.js",
            "config": {
                "distPath": "./dist",
                "remotePath": "/root/dist"
            }
        },

        // Websocket服务示例
        {
            "name": "websocket",
            "type": "websocket",
            "entry": "index.js",
            "config": {
                "distPath": "./dist",
                "remotePath": "/root/websocket/dist"
            }
        }
    ]
}

FAQs

Package last updated on 08 Mar 2019

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