CloudBase Framework already supports one-click deployment of applets

CloudBase Framework already supports one-click deployment of applets

CloudBase Framework is a front-end and back-end integrated deployment tool officially produced by cloud development. No code changes are required. The front-end and back-end one-click hosting deployment is based on the Serverless architecture. Currently, it supports one-click deployment of websites, Next SSR, Node, Dart, Deno and other applications.

For more details, please click on the picture below:

Get through the front and back ends, you must understand this open source "artifact" for improving performance!

Step one preparation

For specific steps, please refer to Prepare cloud development environment and CloudBase CLI command tool, scan the code to view:

Step two enter the project directory to initialize

If it is an existing small program application project

cloudbase

Step 3 One-click deployment

cloudbase framework deploy

Configuration

By default, it only needs to be configured  appidand privateKeyPath can be used. The following configuration parameters are for scenarios with special needs

Configuration example

cloudbase init Later, a configuration file for cloud development will be created cloudbaserc.json , which can be modified and written in the plugins of the configuration file.

{
  "envId": "{{envId}}",
  "framework": {
    "plugins": {
      "client": {
        "use": "@cloudbase/framework-plugin-mp",
        "inputs": {
          "appid": "",
          "privateKeyPath": "",
          "localPath": "./",
          "ignores": ["node_modules/**/*"],
          "deployMode": "preview",
          "previewOptions": {
            "desc": "CloudBase Framework one-click preview",
            "setting": {
              "es6": true
            },
            "qrcodeOutputPath": "./qrcode.jpg",
            "pagePath": "pages/index/index"
          }
        }
      }
    }
  }
}

The appid sum  privateKeyPath of the default template  is empty and needs to be filled in by the developer

Configuration parameter description

appid

Required, the appid of the applet application

privateKeyPath

Required, the local relative path of the deployment private key of the applet application

localPath

Optional, project.config.json the local path where the applet project  is located, the default value ./

ignores

Optional, the file path ignored when the applet application is deployed, supports wildcards, the default value["node_modules/**/*"]

deployMode

Optional, the deployment mode of the applet application, supports  preview|upload 2 deployment modes

previewOptions

deployMode Fill in the  preview need to fill the time previewOptions, the type of object format

Attribute name

Types of

Is it required

description

desc

String

no

The version description of the applet application

setting

IMiniProgramBuildSetting object

no

Compilation settings for applet applications

qrcodeOutputPath

String

no

The path where the generated preview QR code is saved locally

pagePath

String

no

URL of the preview page of the applet application

searchQuery

String

no

Preview page parameters of the applet application

scene

Number

no

The scene value of the preview page of the applet application

E.g

{
  "envId": "{{envId}}",
  "framework": {
    "plugins": {
      "client": {
        "use": "@cloudbase/framework-plugin-mp",
        "inputs": {
          "appid": "",
          "privateKeyPath": "",
          "localPath": "./",
          "ignores": ["node_modules/**/*"],
          "deployMode": "preview",
          "previewOptions": {
            "desc": "One-click preview",
            "setting": {
              "es6": false
            },
            "qrcodeOutputPath": "./qrcode.jpg",
            "pagePath": "pages/index/index",
            "searchQuery": "",
            "scene": 1011
          }
        }
      }
    }
  }
}

uploadOptions

deployMode Fill in the  upload need to fill the time uploadOptions, the type of object format.

Attribute name

Types of

Is it required

description

version

String object

no

The version number uploaded by the Mini Program application

desc

String object

no

The version description of the applet application

setting

IMiniProgramBuildSetting object

no

Compilation settings for applet applications

E.g

{
  "envId": "{{envId}}",
  "framework": {
    "plugins": {
      "client": {
        "use": "@cloudbase/framework-plugin-mp",
        "inputs": {
          "appid": "",
          "privateKeyPath": "",
          "localPath": "./",
          "ignores": ["node_modules/**/*"],
          "deployMode": "upload",
          "uploadOptions": {
            "version": "1.0.0",
            "desc": "CloudBase Framework one-click upload",
            "setting": {
              "es6": false
            }
          }
        }
      }
    }
  }
}

- Drive a key deployment optimization : Optimization Cloud a key deployment speed reduced by about 60s each build deployment build time.

New Login plugin : Auth plugin supports one-click configuration login configuration.

- function plug-in support to configure security rules : Function plug-in support to configure new security rules.

Scan code to view update details

More plugins

It can be used with other plugins in the list of plugins in the github document.

Documentation

  • Cloud development official website address: https://cloudbase.net/
  • Cloud development static website opening guide: https://docs.cloudbase.net/hosting/
  • Cloud development console address: https://console.cloud.tencent.com/tcb

Open source collaboration

The core code of CloudBase Framework has been open sourced on Github:

URL (scan the code or click to read the original text at the end of the article to jump):

https://github.com/TencentCloudBase/cloudbase-framework

Welcome to order a Star for our project and support us to do better~

product description

Cloud Development (Tencent CloudBase, TCB) is a cloud-native integrated development environment and tool platform provided by Tencent Cloud. It provides developers with highly available, automatically and elastically scalable back-end cloud services, including serverless capabilities such as computing, storage, and hosting. , Can be used for cloud integration to develop a variety of end applications (small programs, official accounts, web applications, Flutter clients, etc.) to help developers build and manage back-end services and cloud resources in a unified manner, avoiding cumbersome servers in the application development process With construction and operation and maintenance, developers can focus on the realization of business logic, with lower development thresholds and higher efficiency.

Open cloud development: <https://console.cloud.tencent.com/tcb?tdl_anchor=techsite>

Product documentation: <https://cloud.tencent.com/product/tcb?from=12763>

Technical documentation: <https://cloudbase.net?from=10004>

Technical exchange plus Q group: 601134960

For the latest information, follow the WeChat public account [Tencent Cloud Development]

Reference: https://cloud.tencent.com/developer/article/1742512 CloudBase Framework already supports one-click deployment of small programs-Cloud + Community-Tencent Cloud