Skip to content

Commit

Permalink
docs: update quickstart document
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hu <tao.hu@merico.dev>
  • Loading branch information
daniel-hutao authored and steinliber committed Dec 27, 2022
1 parent e722793 commit 7c45817
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
18 changes: 10 additions & 8 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Quick Start

In this quickstart, we will do the following automatically with DevStream:
In this quickstart, you will do the following automatically with DevStream:

- create a GitHub repository with automatically generated code for a web application written in Golang with the [gin](https://github.com/gin-gonic/gin) framework;
- create a GitHub repository with automatically generated code for a web application written in Golang with the [Gin](https://github.com/gin-gonic/gin) framework;
- set up GitHub Actions workflow for the app created in the previous step.

---
Expand All @@ -20,9 +20,9 @@ sh -c "$(curl -fsSL https://download.devstream.io/download.sh)"
!!! note "Note"
The command above does the following:

- find out your OS and chip architecture
- find the latest version of the `dtm` binary
- download the correct `dtm` according to OS/architecture
- find out your OS and chip architecture;
- find the latest version of the `dtm` binary;
- download the correct `dtm` according to OS/architecture;
- grant the binary execution permission.

!!! quote "Optional"
Expand All @@ -43,16 +43,18 @@ Run the following command to generate the template configuration file `config.ya
Then set the following environment variables by running (replace values within the double quotes):

```shell
export GITHUB_TOKEN="<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN_HERE>"
export GITHUB_USER="<YOUR_GITHUB_USER_NAME_HERE>"
export DOCKERHUB_USERNAME="<YOUR_DOCKER_HUB_USER_NAME_HERE>"
export IMAGE_REPO_PASSWORD="<YOUR_DOCKER_HUB_USER_NAME_HERE>"
export GITHUB_TOKEN="<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN_HERE>"
```

!!! tip "Tip"
Go to [Personal Access Token](https://github.com/settings/tokens/new) to generate a new `GITHUB_TOKEN` for `dtm`.

For "Quick Start", we only need `repo`,`workflow`,`delete_repo` permissions.
For "Quick Start", you only need `repo`,`workflow`,`delete_repo` permissions.

Then we run the following commands to update our config file with those env vars:
Then you should run the following commands to update our config file with those env vars:

=== "**macOS** or **FreeBSD** based systems"

Expand Down
27 changes: 14 additions & 13 deletions docs/quickstart.zh.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# 快速开始

我们将在本文使用 DevStream 自动完成以下操作
在这个“快速开始”流程中,你将使用 DevStream 自动化地完成以下工作

- 创建一个包含了 web 应用程序的 GitHub 仓库,代码基于 [gin](https://github.com/gin-gonic/gin) 框架(用Go语言编写)自动生成
- 为前面创建的仓库设置 GitHub Actions 工作流。
- GitHub 上创建一个包含了自动生成的 Golang [Gin](https://github.com/gin-gonic/gin) 框架代码的 web 应用代码库
- 为这个代码库配置好 GitHub Actions 工作流。

---

Expand All @@ -18,10 +18,10 @@ sh -c "$(curl -fsSL https://download.devstream.io/download.sh)"
!!! note "提示"
上面的命令会做以下事情:

- 检测你的操作系统和芯片架构
- 找到最新版本的 `dtm` 二进制文件
- 根据操作系统和架构下载正确的 `dtm` 二进制文件
- 授予二进制文件执行权限
- 检测你的操作系统和芯片架构
- 找到最新版本的 `dtm` 二进制文件
- 根据操作系统和架构下载正确的 `dtm` 二进制文件
- 授予二进制文件执行权限

!!! quote "可选"
你可以将 `dtm` 移到 PATH 中。例如:`mv dtm /usr/local/bin/`
Expand All @@ -42,18 +42,19 @@ sh -c "$(curl -fsSL https://download.devstream.io/download.sh)"

```shell
export GITHUB_USER="<YOUR_GITHUB_USER_NAME_HERE>"
export GITHUB_TOKEN="<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN_HERE>"
export DOCKERHUB_USERNAME="<YOUR_DOCKER_HUB_USER_NAME_HERE>"
export IMAGE_REPO_PASSWORD="<YOUR_DOCKER_HUB_USER_NAME_HERE>"
export GITHUB_TOKEN="<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN_HERE>"
```

!!! tip "提示"
前往 [Personal Access Token](https://github.com/settings/tokens/new)`dtm` 生成新的 `GITHUB_TOKEN`
参考 [Personal Access Token](https://github.com/settings/tokens/new)`dtm` 生成新的 `GITHUB_TOKEN`

对于“快速开始”,我们只需要勾选 `repo`、`workflow`、`delete_repo` 权限。
对于“快速开始”,你只需要勾选 `repo`、`workflow`、`delete_repo` 权限。

接着,让我们运行以下命令,以使用环境变量来修改配置文件:
接着,你可以运行以下命令,以使用环境变量来修改配置文件:

=== "**macOS** 或 基于 **FreeBSD** 的操作系统"
=== "**macOS** 或基于 **FreeBSD** 的操作系统"

```shell title=""
sed -i.bak "s@YOUR_GITHUB_USERNAME_CASE_SENSITIVE@${GITHUB_USER}@g" config.yaml
Expand All @@ -69,7 +70,7 @@ export DOCKERHUB_USERNAME="<YOUR_DOCKER_HUB_USER_NAME_HERE>"

---

## 3 初始化
## 3 初始化(Init)

运行:

Expand Down

0 comments on commit 7c45817

Please sign in to comment.