From b6d036baba46687f9e86d899044ea13ce9d63bb9 Mon Sep 17 00:00:00 2001 From: zhanghan Date: Fri, 28 Oct 2022 17:39:56 +0800 Subject: [PATCH 1/5] fix: `./blocklet/bundle` -> `.blocklet/bundle` --- developer/docs/pages/how-to/deploy/index.md | 2 +- developer/docs/pages/how-to/deploy/index.zh.md | 2 +- developer/docs/pages/reference/blocklet-cli/index.md | 2 +- developer/docs/pages/reference/blocklet-cli/index.zh.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/developer/docs/pages/how-to/deploy/index.md b/developer/docs/pages/how-to/deploy/index.md index c5f675e..f0afb6d 100644 --- a/developer/docs/pages/how-to/deploy/index.md +++ b/developer/docs/pages/how-to/deploy/index.md @@ -22,7 +22,7 @@ layout: documentation blocklet deploy --endpoint xxxxxx --access-key xxxxxx --access-secret xxxxxx ``` -- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `./blocklet/bundle`. +- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `.blocklet/bundle`. - `--endpoint`: server 的地址,以 /admin 结尾。比如,你本地的 Blocklet Server 的地址是 `http://127.0.0.1/admin` - `--access-key`: 第一步创建的 Access Key - `--access-secret`: 第一步创建的 Access Secret diff --git a/developer/docs/pages/how-to/deploy/index.zh.md b/developer/docs/pages/how-to/deploy/index.zh.md index 80a124e..7f66ad3 100644 --- a/developer/docs/pages/how-to/deploy/index.zh.md +++ b/developer/docs/pages/how-to/deploy/index.zh.md @@ -22,7 +22,7 @@ layout: documentation blocklet deploy --endpoint xxxxxx --access-key xxxxxx --access-secret xxxxxx ``` -- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `./blocklet/bundle`. +- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `.blocklet/bundle`. - `--endpoint`: server 的地址,以 /admin 结尾。比如,你本地的 Blocklet Server 的地址是 `http://127.0.0.1/admin` - `--access-key`: 第一步创建的 Access Key - `--access-secret`: 第一步创建的 Access Secret diff --git a/developer/docs/pages/reference/blocklet-cli/index.md b/developer/docs/pages/reference/blocklet-cli/index.md index 81d6534..c31d409 100644 --- a/developer/docs/pages/reference/blocklet-cli/index.md +++ b/developer/docs/pages/reference/blocklet-cli/index.md @@ -168,7 +168,7 @@ $ blocklet bundle $ blocklet deploy --endpoint xxxxxx --access-key xxxxxx --access-secret xxxxxx ``` -- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `./blocklet/bundle`. +- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `.blocklet/bundle`. - `--endpoint`: server 的地址,以 /admin 结尾。比如,你本地的 Blocklet Server 的地址是 `http://127.0.0.1/admin` - `--access-key`: 在 Blocklet Server 创建的 Access Key - `--access-secret`: 在 Blocklet Server 创建的 Access Secret diff --git a/developer/docs/pages/reference/blocklet-cli/index.zh.md b/developer/docs/pages/reference/blocklet-cli/index.zh.md index d1e4f24..5ad4133 100644 --- a/developer/docs/pages/reference/blocklet-cli/index.zh.md +++ b/developer/docs/pages/reference/blocklet-cli/index.zh.md @@ -168,7 +168,7 @@ $ blocklet bundle $ blocklet deploy --endpoint xxxxxx --access-key xxxxxx --access-secret xxxxxx ``` -- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `./blocklet/bundle`. +- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `.blocklet/bundle`. - `--endpoint`: server 的地址,以 /admin 结尾。比如,你本地的 Blocklet Server 的地址是 `http://127.0.0.1/admin` - `--access-key`: 在 Blocklet Server 创建的 Access Key - `--access-secret`: 在 Blocklet Server 创建的 Access Secret From a6338644e761faacfc899df0ff224d241e1e66d4 Mon Sep 17 00:00:00 2001 From: zhanghan Date: Fri, 28 Oct 2022 17:40:32 +0800 Subject: [PATCH 2/5] fix: correct links "Blocklet UI" --- developer/docs/pages/how-to/auth/index.md | 2 +- developer/docs/pages/how-to/auth/index.zh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/developer/docs/pages/how-to/auth/index.md b/developer/docs/pages/how-to/auth/index.md index e6b93de..fcb752e 100644 --- a/developer/docs/pages/how-to/auth/index.md +++ b/developer/docs/pages/how-to/auth/index.md @@ -71,7 +71,7 @@ export default function App() { } ``` -More: [Blocklet UI](/development/blocklet-ui-usage) +More: [Blocklet UI](/reference/blocklet-ui) ### Use default login page diff --git a/developer/docs/pages/how-to/auth/index.zh.md b/developer/docs/pages/how-to/auth/index.zh.md index bd8ca2c..76760ab 100644 --- a/developer/docs/pages/how-to/auth/index.zh.md +++ b/developer/docs/pages/how-to/auth/index.zh.md @@ -71,7 +71,7 @@ export default function App() { } ``` -更多:[Blocklet UI](/development/blocklet-ui-usage) +更多:[Blocklet UI](/reference/blocklet-ui) ### 使用默认的登录页 From b29b1372fe3d76fdad4a50a9bcd0838072592466 Mon Sep 17 00:00:00 2001 From: zhanghan Date: Fri, 28 Oct 2022 17:41:09 +0800 Subject: [PATCH 3/5] chore: update "reference/blocklet-actions" docs --- .../pages/reference/blocklet-actions/index.md | 116 ++++++++++++++++- .../reference/blocklet-actions/index.zh.md | 119 ++++++++++++++++-- 2 files changed, 222 insertions(+), 13 deletions(-) diff --git a/developer/docs/pages/reference/blocklet-actions/index.md b/developer/docs/pages/reference/blocklet-actions/index.md index a306dc3..f406740 100644 --- a/developer/docs/pages/reference/blocklet-actions/index.md +++ b/developer/docs/pages/reference/blocklet-actions/index.md @@ -16,7 +16,7 @@ With action-workflow, we can quickly configure the flow in CI for each Blocklet First your project needs to create a `.github` folder to enable the [GitHub Actions](https://docs.github.com/en/actions) feature -Then create a `workflows/main.yml` file in `.github` and configure some necessary initialization processes. Such as `git checkout`, `dependencies install`, etc. +Then create a `workflows/main.yml` file in `.github` and configure some necessary initialization processes. Such as `git checkout`, `dependencies install`, etc. A full example can be found here: [Blocklet Site](https://github.com/blocklet/publish-kit/blob/master/.github/workflows/main.yml) Once everything is in place, add the following to access the Blocklet action-workflow functionality. @@ -44,21 +44,125 @@ Once everything is in place, add the following to access the Blocklet action-wor github-token: xxxxx ``` +### Function Introduction + +Blocklet action-workflow consists of five major functions: environment preparation, project packaging, uploading to Blocklet Store, deploying to Blocklet Server, and releasing to Github Release. + +The following is a detailed description of action-workflow by function: + +#### Base configuration +- `working-directory`: The directory where the Blocklet action-workflow is executed, often used in monorepo, where multiple Blocklet applications need to be packaged, uploaded and released at the same time, default is `. /` + +#### Environment Preparation + - `skip-deps`: Whether to skip the blocklet-server environment preparation step, default is ``false`'' + +#### Bundle + - `skip-bundle`: Whether to skip the bundle step, default is ``false`'' -- `skip-upload`: Whether to skip uploading Blocklet applications to Blocklet Store, default is `true`. -- `skip-deploy`: Whether to skip the step of deploying the Blocklet application to the specified Blocklet Server, default is `true`. -- `skip-release`: Whether to skip the release Github Release step, default is `false` -- `skip-readme`: Whether to skip the step of updating the `README.md` file, default is `false` -- `working-directory`: The directory where the Blocklet action-workflow is executed, often used in monorepo, where multiple Blocklet applications need to be packaged, uploaded and released at the same time, default is `. /` - `bundle-command`: The command to package Blocklet applications, usually `npm run bundle`, if `skip-bundle` is not `true`, then this item is required + +#### Upload to Blocklet Store +- `skip-upload`: Whether to skip uploading Blocklet applications to Blocklet Store, default is `true`. - `store-endpoint`: The URL of the Blocklet Store, you can freely configure which Blocklet Store you need to upload the application to, if `skip-upload` is not `true`, then this item is required - `store-access-token`: The key applied in Blocklet Store, you need to register as the developer of the corresponding Blocklet Store first, then apply for an upload key, if `skip-upload` is not `true`, then this item is required. For more details, please refer to: [Blocklet Store](https://store.blocklet.dev/docs) - `store-developer-did`: The developer ID of the developer in the corresponding Blocklet Store, this item is required when you need to upload a paid Blocklet. For more details, please refer to: [Blocklet Store](https://store.blocklet.dev/docs) + +#### Deploy to Blocklet Server +- `skip-deploy`: Whether to skip the step of deploying the Blocklet application to the specified Blocklet Server, default is `true`. - `server-endpoint`: The address of the Blocklet Server to be deployed, if `skip-deploy` is not empty. For more details, please refer to: [Blocklet Deploy](/reference/blocklet-cli#deploy) - `server-access-key`: Access Key created in Blocklet Server, if `skip-deploy` is not empty. For more details, please refer to: [Blocklet Deploy](/reference/blocklet-cli#deploy) - `server-access-secret`: The Access Secret `skip-deploy` created in Blocklet Server is not empty. For more details, please refer to: [Blocklet Deploy](/reference/blocklet-cli#deploy) - `deploy-app-did`: Under which Blocklet application the current application will be deployed (become its sub-component), if you need to deploy the application as a sub-component, you need to fill in this item. For more details, please refer to: [Blocklet Deploy](/reference/blocklet-cli#deploy) - `deploy-mount-point`: The path where the application is mounted when it is deployed as a subcomponent, if you need to deploy the application as a subcomponent, you need to fill in this item. For more details, please refer to: [Blocklet Deploy](/reference/blocklet-cli#deploy) - `slack-webhook`: Configure a slack webhook to send a slack notification when the Blocklet application is successfully deployed. + +#### Release to Github Release +- `skip-release`: Whether to skip the release Github Release step, default is `false` +- `skip-readme`: Whether to skip the step of updating the `README.md` file, default is `false` - `github-token`: Configure a `token` with `write` permissions that will be used to update the project's `README.md` file in CI + + +### Usage Scenarios +The following is a description of how action-workflow can be combined in each scenario +#### Upload blocklet to Blocklet Store +After completing the development of the application, you want to be able to publish the latest code to the Blocklet Store every time, this time you need to use the `Environment Preparation`, `Bundle`, `Upload to Blocklet Store` steps, refer to the following code: +```yaml +- name: Upload to Blocklet Store + uses: blocklet/action-workflow@v1 + with: + skip-deps: false + skip-bundle: false + skip-upload: false + skip-deploy: true + skip-release: true + skip-readme: true + bundle-command: npm run bundle + store-endpoint: ${{ secrets.STORE_ENDPOINT }} + store-access-token: ${{ secrets.STORE_ACCESS_TOKEN }} + store-developer-did: ${{ secrets.STORE_DEVELOPER_DID }} +``` + +#### Deploy blocklet to Blocklet Server +In some cases, you do not want to publish the application to the Blocklet Store, but deploy it directly to a specified Blocklet Server, you need to use the `Environment Preparation`, `Bundle`, `Deploy to Blocklet Server` steps, refer to the following code: +```yaml +- name: Deploy to Blocklet Server + uses: blocklet/action-workflow@v1 + with: + skip-deps: false + skip-bundle: false + skip-upload: true + skip-deploy: false + skip-release: true + skip-readme: true + bundle-command: npm run bundle + server-endpoint: ${{ secrets.XMARK_NODE_ENDPOINT }} + server-access-key: ${{ secrets.XMARK_NODE_ACCESS_KEY }} + server-access-secret: ${{ secrets.XMARK_NODE_ACCESS_SECRET }} + slack-webhook: xxxxxx +``` + +If the application needs to be deployed as a component blocklet of another blocklet, it can be configured by adding the following parameters: +```yaml +deploy-app-did: xxxxxx +deploy-mount-point: xxxxxx +``` + +#### Release to Github Release +In some cases, you want to package the current application for an archive, and then install and run it in the future through Blocklet Server, you need to use the `Environment Preparation`, `Bundle`, `Release to Github Release` steps, refer to the following code. +```yaml +- name: Release to Github Release + uses: blocklet/action-workflow@v1 + with: + skip-deps: false + skip-bundle: false + skip-upload: true + skip-deploy: true + skip-release: false + skip-readme: true + bundle-command: npm run bundle + github-token: ${{ secrets.GITHUB_TOKEN }} +``` + +#### Other situations +The above three cases describe three common scenarios, sometimes you need to combine the above three scenarios to meet the use of more cases. For example, if you need to publish to Blocklet Store and deploy to Blocklet Server at the same time, you can combine the above described configuration by referring to the following code: + +```yaml +- name: Upload to Blocklet Store & Deploy to Blocklet Store + uses: blocklet/action-workflow@v1 + with: + skip-deps: false + skip-bundle: false + skip-upload: false + skip-deploy: false + skip-release: true + skip-readme: true + bundle-command: npm run bundle + store-endpoint: ${{ secrets.STORE_ENDPOINT }} + store-access-token: ${{ secrets.STORE_ACCESS_TOKEN }} + store-developer-did: ${{ secrets.STORE_DEVELOPER_DID }} + server-endpoint: ${{ secrets.XMARK_NODE_ENDPOINT }} + server-access-key: ${{ secrets.XMARK_NODE_ACCESS_KEY }} + server-access-secret: ${{ secrets.XMARK_NODE_ACCESS_SECRET }} + slack-webhook: xxxxxx +``` diff --git a/developer/docs/pages/reference/blocklet-actions/index.zh.md b/developer/docs/pages/reference/blocklet-actions/index.zh.md index e2f7359..2c85633 100644 --- a/developer/docs/pages/reference/blocklet-actions/index.zh.md +++ b/developer/docs/pages/reference/blocklet-actions/index.zh.md @@ -16,7 +16,7 @@ layout: documentation 首先你的项目需要先创建一个 `.github` 文件夹,来开启 [GitHub Actions](https://docs.github.com/cn/actions) 功能 -然后创建一个在 `.github` 中创建 `workflows/main.yml` 文件,并配置一些必备的初始化流程。比如 `git checkout`、`dependencies install` 等。 +然后创建一个在 `.github` 中创建 `workflows/main.yml` 文件,并配置一些必备的初始化流程。比如 `git checkout`、`dependencies install` 等。完整的例子可以参考这里:[Blocklet Site](https://github.com/blocklet/publish-kit/blob/master/.github/workflows/main.yml) 一切就绪之后,增加以下内容用来接入 Blocklet action-workflow 功能: @@ -41,24 +41,129 @@ layout: documentation deploy-app-did: xxxxxx deploy-mount-point: xxxxxx slack-webhook: xxxxxx - github-token: xxxxx + github-token: ${{ secrets.GITHUB_TOKEN }} ``` +### 功能介绍 + +Blocklet action-workflow 共包含:环境准备、项目打包、上传至 Blocklet Store、部署至 Blocklet Server、发布 Github Release 五大功能。 + +以下按照功能划分对 action-workflow 进行详细介绍 + +#### 基础部分 +- `working-directory`:执行 Blocklet action-workflow 的目录,常用于 monorepo 中,同时存在多个 Blocklet 应用需要进行打包、上传、发布等步骤,默认为 `./` + +#### 环境准备 + - `skip-deps`:是否跳过 blocklet-server 环境准备步骤,默认为 `false` + +#### 项目打包 + - `skip-bundle`:是否跳过 bundle 步骤,默认为 `false` -- `skip-upload`:是否跳过上传 Blocklet 应用到 Blocklet Store 步骤,默认为 `true` -- `skip-deploy`:是否跳过部署 Blocklet 应用到指定的 Blocklet Server 步骤,默认为 `true` -- `skip-release`:是否跳过发布 Github Release 步骤,默认为 `false` -- `skip-readme`:是否跳过更新 `README.md` 文件步骤,默认为 `false` -- `working-directory`:执行 Blocklet action-workflow 的目录,常用于 monorepo 中,同时存在多个 Blocklet 应用需要进行打包、上传、发布等步骤,默认为 `./` - `bundle-command`:Blocklet 应用打包的命令,一般情况下都是 `npm run bundle`,如果 `skip-bundle` 不为 `true`,则该项为必填项 + +#### 上传至 Blocklet Store +- `skip-upload`:是否跳过上传 Blocklet 应用到 Blocklet Store 步骤,默认为 `true` - `store-endpoint`:Blocklet Store 的网址,可自由配置需要将应用上传到哪个 Blocklet Store,如果 `skip-upload` 不为 `true`,则该项为必填项 - `store-access-token`:在 Blocklet Store 中申请的密钥,需要先注册为对应 Blocklet Store 的开发者,然后申请一个上传密钥,如果 `skip-upload` 不为 `true`,则该项为必填项。更详细的内容请参考:[Blocklet Store](https://store.blocklet.dev/docs) - `store-developer-did`:开发者在对应 Blocklet Store 中的开发者 ID,当需要上传一个付费的 Blocklet 时,该项是必填项。更详细的内容请参考:[Blocklet Store](https://store.blocklet.dev/docs) + +#### 部署至 Blocklet Server +- `skip-deploy`:是否跳过部署 Blocklet 应用到指定的 Blocklet Server 步骤,默认为 `true` - `server-endpoint`:要部署的 Blocklet Server 地址,如果 `skip-deploy` 不为空。更详细的内容请参考:[Blocklet Deploy](/reference/blocklet-cli#deploy) - `server-access-key`:在 Blocklet Server 创建的 Access Key,如果 `skip-deploy` 不为空。更详细的内容请参考:[Blocklet Deploy](/reference/blocklet-cli#deploy) - `server-access-secret`:在 Blocklet Server 创建的 Access Secret `skip-deploy` 不为空。更详细的内容请参考:[Blocklet Deploy](/reference/blocklet-cli#deploy) - `deploy-app-did`:将当前应用部署在哪一个 Blocklet 应用下(成为其子组件),如果需要将该应用作为子组件来部署,则需要填写该项。更详细的内容请参考:[Blocklet Deploy](/reference/blocklet-cli#deploy) - `deploy-mount-point`:该应用作为子组件部署时,配置其挂载的路径,如果需要将该应用作为子组件来部署,则需要填写该项。更详细的内容请参考:[Blocklet Deploy](/reference/blocklet-cli#deploy) - `slack-webhook`:配置一个 slack 的 webhook,用于在 Blocklet 应用成功部署后发一个 slack 通知。 + +#### 发布 Github Release +- `skip-release`:是否跳过发布 Github Release 步骤,默认为 `false` +- `skip-readme`:是否跳过更新 `README.md` 文件步骤,默认为 `false` - `github-token`:配置一个具有 `write` 权限的 `token`,该 `token` 将用于在 CI 中更新项目的 `README.md` 文件 + + + +### 使用场景 +以下从使用场景出发,介绍各个场景下如何组合出 action-workflow 的使用方式 +#### 发布应用到 Blocklet Store +在完成应用的开发后,希望能够每次将最新的代码发布到 Blocklet Store 中,这个时候需要用上 `环境准备`、`项目打包`、`上传至 Blocklet Store` 步骤,参考如下代码: +```yaml +- name: Upload to Blocklet Store + uses: blocklet/action-workflow@v1 + with: + skip-deps: false + skip-bundle: false + skip-upload: false + skip-deploy: true + skip-release: true + skip-readme: true + bundle-command: npm run bundle + store-endpoint: ${{ secrets.STORE_ENDPOINT }} + store-access-token: ${{ secrets.STORE_ACCESS_TOKEN }} + store-developer-did: ${{ secrets.STORE_DEVELOPER_DID }} +``` + +#### 部署应用到 Blocklet Server +在某些情况下,不希望应用发布到 Blocklet Store,而直接部署到一台指定的 Blocklet Server 中,这个时候需要用上 `环境准备`、`项目打包`、`部署至 Blocklet Server` 步骤,参考如下代码: +```yaml +- name: Deploy to Blocklet Server + uses: blocklet/action-workflow@v1 + with: + skip-deps: false + skip-bundle: false + skip-upload: true + skip-deploy: false + skip-release: true + skip-readme: true + bundle-command: npm run bundle + server-endpoint: ${{ secrets.XMARK_NODE_ENDPOINT }} + server-access-key: ${{ secrets.XMARK_NODE_ACCESS_KEY }} + server-access-secret: ${{ secrets.XMARK_NODE_ACCESS_SECRET }} + slack-webhook: xxxxxx +``` + +如果需要将应用部署为另一个应用的子组件,可以加上以下参数进行配置: +```yaml +deploy-app-did: xxxxxx +deploy-mount-point: xxxxxx +``` + +#### 发布 Github Release +在某些情况下,想要把当前应用打包进行一个存档,在将来再通过 Blocklet Server 进行安装运行,这个时候需要用上 `环境准备`、`项目打包`、`发布 Github Release` 步骤,参考如下代码: +```yaml +- name: Release to Github + uses: blocklet/action-workflow@v1 + with: + skip-deps: false + skip-bundle: false + skip-upload: true + skip-deploy: true + skip-release: false + skip-readme: true + bundle-command: npm run bundle + github-token: ${{ secrets.GITHUB_TOKEN }} +``` + +#### 其他情况 +上面三种情况描述了三种常用的场景用法,有时候需要组合上面三种场景用法来满足更多情况下的使用。比如需要同时发布到 Blocklet Store 和部署到 Blocklet Server,此时通过组合上面描述的配置即可,参考如下代码: + +```yaml +- name: Upload to Blocklet Store & Deploy to Blocklet Store + uses: blocklet/action-workflow@v1 + with: + skip-deps: false + skip-bundle: false + skip-upload: false + skip-deploy: false + skip-release: true + skip-readme: true + bundle-command: npm run bundle + store-endpoint: ${{ secrets.STORE_ENDPOINT }} + store-access-token: ${{ secrets.STORE_ACCESS_TOKEN }} + store-developer-did: ${{ secrets.STORE_DEVELOPER_DID }} + server-endpoint: ${{ secrets.XMARK_NODE_ENDPOINT }} + server-access-key: ${{ secrets.XMARK_NODE_ACCESS_KEY }} + server-access-secret: ${{ secrets.XMARK_NODE_ACCESS_SECRET }} + slack-webhook: xxxxxx +``` From 52055be142e475701a9e2a324286125ab2faea65 Mon Sep 17 00:00:00 2001 From: zhanghan Date: Fri, 28 Oct 2022 17:56:26 +0800 Subject: [PATCH 4/5] chore: update "how-to/deploy" docs --- developer/docs/pages/how-to/deploy/index.md | 30 ++++++++++--------- .../docs/pages/how-to/deploy/index.zh.md | 4 ++- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/developer/docs/pages/how-to/deploy/index.md b/developer/docs/pages/how-to/deploy/index.md index f0afb6d..1a7a813 100644 --- a/developer/docs/pages/how-to/deploy/index.md +++ b/developer/docs/pages/how-to/deploy/index.md @@ -4,40 +4,42 @@ description: Deploy blocklet directly to the server layout: documentation --- -如果你是 blocklet 的开发者,或者你有 blocklet 的 release bundle, 你可以将 blocklet 直接部署到你的 Blocklet Server 中 +Before you can deploy, you need to make sure you have a release bundle file that can be used for deployment. Generally, release bundle files can be obtained by bundle from the project's source code, see here: [Bundle](/how-to/bundle), or someone else can share the release bundle with you. -## 将 Blocklet 部署到 Blocklet Server +With the release bundle file in place, you can deploy the blocklet directly to your Blocklet Server + +## Deploy your blocklet to Blocklet Server ### STEP 1 -在你的 Blocklet Server 创建 Access Key +Create Access Key in your Blocklet Server ![](./access-key.png) ### STEP 2 -执行 `blocklet deploy` 命令,将 blocklet 部署到 Blocklet Server +Execute the `blocklet deploy` command to deploy the blocklet to the Blocklet Server ```bash blocklet deploy --endpoint xxxxxx --access-key xxxxxx --access-secret xxxxxx ``` -- blocklet-bundle-folder: 使用 [blocklet bundle](/how-to/bundle) 构建后的目录,如果当前你在项目根目录,则是 `.blocklet/bundle`. -- `--endpoint`: server 的地址,以 /admin 结尾。比如,你本地的 Blocklet Server 的地址是 `http://127.0.0.1/admin` -- `--access-key`: 第一步创建的 Access Key -- `--access-secret`: 第一步创建的 Access Secret +- blocklet-bundle-folder: The directory after building with [blocklet bundle](/how-to/bundle), or if you are currently in the root of the project, the value is `.blocklet/bundle`. +- `--endpoint`: The address of the server, ending with /admin. For example, the address of your local Blocklet Server is `http://127.0.0.1/admin` +- `--access-key`: The Access Key created in the first step +- `--access-secret`: Access Secret created in the first step -## 将 Blocklet 部署到本机的 Blocklet Server +## Deploy your blocklet to local Blocklet Server -如果你想将 Blocklet 部署到本机的 Blocklet Server, 则可以直接执行 `blocklet deploy ` +If you want to deploy the Blocklet to the local Blocklet Server, you can directly execute `blocklet deploy ` -## 将 Component 部署到 Blocklet Server +## Deploy component blocklet to Blocklet Server -部署 Component 到 Blocklet Server 与部署 Blocklet 的命令相同,你需要添加额外的参数 +Deploying a component blocklet to Blocklet Server is the same command as deploying a Blocklet, but you need to add additional parameters ``` blocklet deploy --endpoint xxxxxx --access-key xxxxxx --access-secret xxxxxx --app-id --mount-point /xxx` ``` -- `--app-id`: 应用的 AppID, 可在 blocklet 详情页中查看 -- `--mount-point`: 组件的挂载点 +- `--app-id`: AppID of the application, available in the blocklet details page +- `--mount-point`: Mount points for components diff --git a/developer/docs/pages/how-to/deploy/index.zh.md b/developer/docs/pages/how-to/deploy/index.zh.md index 7f66ad3..c15289d 100644 --- a/developer/docs/pages/how-to/deploy/index.zh.md +++ b/developer/docs/pages/how-to/deploy/index.zh.md @@ -4,7 +4,9 @@ description: 部署应用到节点 layout: documentation --- -如果你是 blocklet 的开发者,或者你有 blocklet 的 release bundle, 你可以将 blocklet 直接部署到你的 Blocklet Server 中 +在进行部署操作前,你需要确保你拥有可用于部署的 release bundle 文件。通常来说 release bundle 文件可以通过从项目的源码中打包获得,打包步骤可以参考这里:[Bundle](/how-to/bundle),也可以是其他人将已经打包好的 release bundle 分享给你。 + +在拥有了 release bundle 文件后,你可以将 blocklet 直接部署到你的 Blocklet Server 中 ## 将 Blocklet 部署到 Blocklet Server From 73fe352166cb0823af4b48e7d76b587d12653d9e Mon Sep 17 00:00:00 2001 From: zhanghan Date: Fri, 28 Oct 2022 18:00:33 +0800 Subject: [PATCH 5/5] chore(release): v0.1.98 --- CHANGELOG.md | 7 +++++++ developer/docs/blocklet.yml | 2 +- developer/pages/blocklet.yml | 2 +- version | 2 +- website/docs/blocklet.yml | 2 +- website/pages/blocklet.yml | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5e6038..32da2c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.1.98 (October 28, 2022) + +- chore: update "how-to/deploy" docs +- chore: update "reference/blocklet-actions" docs +- fix: correct links "Blocklet UI" +- fix: `./blocklet/bundle` -> `.blocklet/bundle` + ## 0.1.97 (October 28, 2022) - docs: update blocklet.yml: requirements diff --git a/developer/docs/blocklet.yml b/developer/docs/blocklet.yml index 544a068..d54cb26 100644 --- a/developer/docs/blocklet.yml +++ b/developer/docs/blocklet.yml @@ -14,7 +14,7 @@ repository: type: git url: git+https://github.com/blocklet/blocklet-site.git specVersion: 1.2.7 -version: 0.1.97 +version: 0.1.98 logo: logo.png files: - hooks/post-start.js diff --git a/developer/pages/blocklet.yml b/developer/pages/blocklet.yml index f1da985..55fb7a5 100644 --- a/developer/pages/blocklet.yml +++ b/developer/pages/blocklet.yml @@ -13,7 +13,7 @@ repository: type: git url: git+https://github.com/blocklet/blocklet-site.git specVersion: 1.2.7 -version: 0.1.97 +version: 0.1.98 logo: logo.png files: [] interfaces: diff --git a/version b/version index 7cd2918..5d5322d 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.1.97 +0.1.98 diff --git a/website/docs/blocklet.yml b/website/docs/blocklet.yml index c2e0289..86bd574 100644 --- a/website/docs/blocklet.yml +++ b/website/docs/blocklet.yml @@ -14,7 +14,7 @@ repository: type: git url: git+https://github.com/blocklet/blocklet-site.git specVersion: 1.2.7 -version: 0.1.97 +version: 0.1.98 logo: logo.png files: [] interfaces: diff --git a/website/pages/blocklet.yml b/website/pages/blocklet.yml index 4c558fc..52a07f9 100644 --- a/website/pages/blocklet.yml +++ b/website/pages/blocklet.yml @@ -13,7 +13,7 @@ repository: type: git url: git+https://github.com/blocklet/blocklet-site.git specVersion: 1.2.7 -version: 0.1.97 +version: 0.1.98 logo: logo.png files: [] interfaces: