Skip to content

Commit 6bdde74

Browse files
authored
Merge pull request #1297 from aFlyBird0/update-docs-quickstart-cn
docs: translate and beautify quickstart docs
2 parents 461af71 + a762fe3 commit 6bdde74

File tree

2 files changed

+225
-239
lines changed

2 files changed

+225
-239
lines changed

docs/quickstart.md

Lines changed: 105 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@ In your working directory, run:
1414
```shell
1515
sh -c "$(curl -fsSL https://raw.githubusercontent.com/devstream-io/devstream/main/hack/install/download.sh)"
1616
```
17-
> Note: the command above does the following:
18-
>
19-
> - find out your OS and chip architecture
20-
> - find the latest version of the `dtm` binary
21-
> - download the correct `dtm` according to OS/architecture
22-
> - grant the binary execution permission.
23-
>
24-
> Optional: you can then move `dtm` to a place which is in your PATH. For example: `mv dtm /usr/local/bin/`.
25-
>
26-
> For more ways to install `dtm`, see [install dtm](./install.md).
17+
18+
!!! note "Note"
19+
the command above does the following:
20+
21+
- find out your OS and chip architecture
22+
- find the latest version of the `dtm` binary
23+
- download the correct `dtm` according to OS/architecture
24+
- grant the binary execution permission.
25+
26+
!!! quote "Optional"
27+
You can then move `dtm` to a place which is in your PATH. For example: `mv dtm /usr/local/bin/`.
28+
29+
For more ways to install `dtm`, see [install dtm](./install.md).
2730

2831
---
2932

@@ -43,25 +46,26 @@ export GITHUB_TOKEN="<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN_HERE>"
4346
export DOCKERHUB_USERNAME="<YOUR_DOCKER_HUB_USER_NAME_HERE>"
4447
```
4548

46-
> Tip: go to [Personal Access Token](https://github.com/settings/tokens/new) to generate a new `GITHUB_TOKEN` for `dtm`.
47-
>
48-
> For "Quick Start", we only need `repo`,`workflow`,`delete_repo` permissions.
49+
!!! tip "Tip"
50+
Go to [Personal Access Token](https://github.com/settings/tokens/new) to generate a new `GITHUB_TOKEN` for `dtm`.
51+
52+
For "Quick Start", we only need `repo`,`workflow`,`delete_repo` permissions.
4953

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

52-
Then, if you are using **macOS** or **FreeBSD** based systems\, run:
56+
=== "**macOS** or **FreeBSD** based systems"
5357

54-
```shell
55-
sed -i.bak "s@YOUR_GITHUB_USERNAME_CASE_SENSITIVE@${GITHUB_USER}@g" config.yaml
56-
sed -i.bak "s@YOUR_DOCKER_USERNAME@${DOCKERHUB_USERNAME}@g" config.yaml
57-
```
58+
```shell
59+
sed -i.bak "s@YOUR_GITHUB_USERNAME_CASE_SENSITIVE@${GITHUB_USER}@g" config.yaml
60+
sed -i.bak "s@YOUR_DOCKER_USERNAME@${DOCKERHUB_USERNAME}@g" config.yaml
61+
```
5862

59-
> For **GNU** Linux users, run:
60-
>
61-
> ```shell
62-
> sed -i "s@YOUR_GITHUB_USERNAME_CASE_SENSITIVE@${GITHUB_USER}@g" config.yaml
63-
> sed -i "s@YOUR_DOCKER_USERNAME@${DOCKERHUB_USERNAME}@g" config.yaml
64-
> ```
63+
=== "**GNU** Linux users"
64+
65+
```shell
66+
sed -i "s@YOUR_GITHUB_USERNAME_CASE_SENSITIVE@${GITHUB_USER}@g" config.yaml
67+
sed -i "s@YOUR_DOCKER_USERNAME@${DOCKERHUB_USERNAME}@g" config.yaml
68+
```
6569

6670
---
6771

@@ -73,29 +77,29 @@ Run:
7377
./dtm init
7478
```
7579

76-
> You should see some output similar to the following:
77-
```
78-
2022-12-02 16:11:55 ℹ [INFO] Using dir </Users/tiexin/.devstream/plugins> to store plugins.
79-
2022-12-02 16:11:55 ℹ [INFO] -------------------- [ repo-scaffolding-darwin-arm64_0.10.1 ] --------------------
80-
2022-12-02 16:11:57 ℹ [INFO] Downloading: [repo-scaffolding-darwin-arm64_0.10.1.so] ...
81-
87.82 MiB / 87.82 MiB [================================] 100.00% 12.30 MiB/s 7s
82-
2022-12-02 16:12:04 ✔ [SUCCESS] [repo-scaffolding-darwin-arm64_0.10.1.so] download succeeded.
83-
2022-12-02 16:12:04 ℹ [INFO] Downloading: [repo-scaffolding-darwin-arm64_0.10.1.md5] ...
84-
33 B / 33 B [==========================================] 100.00% 50.98 KiB/s 0s
85-
2022-12-02 16:12:04 ✔ [SUCCESS] [repo-scaffolding-darwin-arm64_0.10.1.md5] download succeeded.
86-
2022-12-02 16:12:04 ℹ [INFO] Initialize [repo-scaffolding-darwin-arm64_0.10.1] finished.
87-
2022-12-02 16:12:04 ℹ [INFO] -------------------- [ repo-scaffolding-darwin-arm64_0.10.1 ] --------------------
88-
2022-12-02 16:12:04 ℹ [INFO] -------------------- [ githubactions-golang-darwin-arm64_0.10.1 ] --------------------
89-
2022-12-02 16:12:05 ℹ [INFO] Downloading: [githubactions-golang-darwin-arm64_0.10.1.so] ...
90-
86.44 MiB / 86.44 MiB [================================] 100.00% 15.12 MiB/s 5s
91-
2022-12-02 16:12:10 ✔ [SUCCESS] [githubactions-golang-darwin-arm64_0.10.1.so] download succeeded.
92-
2022-12-02 16:12:10 ℹ [INFO] Downloading: [githubactions-golang-darwin-arm64_0.10.1.md5] ...
93-
33 B / 33 B [==========================================] 100.00% 71.24 KiB/s 0s
94-
2022-12-02 16:12:10 ✔ [SUCCESS] [githubactions-golang-darwin-arm64_0.10.1.md5] download succeeded.
95-
2022-12-02 16:12:11 ℹ [INFO] Initialize [githubactions-golang-darwin-arm64_0.10.1] finished.
96-
2022-12-02 16:12:11 ℹ [INFO] -------------------- [ githubactions-golang-darwin-arm64_0.10.1 ] --------------------
97-
2022-12-02 16:12:11 ✔ [SUCCESS] Initialize finished.
98-
```
80+
!!! success "You should see some output similar to the following"
81+
```text title=""
82+
2022-12-02 16:11:55 ℹ [INFO] Using dir </Users/tiexin/.devstream/plugins> to store plugins.
83+
2022-12-02 16:11:55 ℹ [INFO] -------------------- [ repo-scaffolding-darwin-arm64_0.10.1 ] --------------------
84+
2022-12-02 16:11:57 ℹ [INFO] Downloading: [repo-scaffolding-darwin-arm64_0.10.1.so] ...
85+
87.82 MiB / 87.82 MiB [================================] 100.00% 12.30 MiB/s 7s
86+
2022-12-02 16:12:04 ✔ [SUCCESS] [repo-scaffolding-darwin-arm64_0.10.1.so] download succeeded.
87+
2022-12-02 16:12:04 ℹ [INFO] Downloading: [repo-scaffolding-darwin-arm64_0.10.1.md5] ...
88+
33 B / 33 B [==========================================] 100.00% 50.98 KiB/s 0s
89+
2022-12-02 16:12:04 ✔ [SUCCESS] [repo-scaffolding-darwin-arm64_0.10.1.md5] download succeeded.
90+
2022-12-02 16:12:04 ℹ [INFO] Initialize [repo-scaffolding-darwin-arm64_0.10.1] finished.
91+
2022-12-02 16:12:04 ℹ [INFO] -------------------- [ repo-scaffolding-darwin-arm64_0.10.1 ] --------------------
92+
2022-12-02 16:12:04 ℹ [INFO] -------------------- [ githubactions-golang-darwin-arm64_0.10.1 ] --------------------
93+
2022-12-02 16:12:05 ℹ [INFO] Downloading: [githubactions-golang-darwin-arm64_0.10.1.so] ...
94+
86.44 MiB / 86.44 MiB [================================] 100.00% 15.12 MiB/s 5s
95+
2022-12-02 16:12:10 ✔ [SUCCESS] [githubactions-golang-darwin-arm64_0.10.1.so] download succeeded.
96+
2022-12-02 16:12:10 ℹ [INFO] Downloading: [githubactions-golang-darwin-arm64_0.10.1.md5] ...
97+
33 B / 33 B [==========================================] 100.00% 71.24 KiB/s 0s
98+
2022-12-02 16:12:10 ✔ [SUCCESS] [githubactions-golang-darwin-arm64_0.10.1.md5] download succeeded.
99+
2022-12-02 16:12:11 ℹ [INFO] Initialize [githubactions-golang-darwin-arm64_0.10.1] finished.
100+
2022-12-02 16:12:11 ℹ [INFO] -------------------- [ githubactions-golang-darwin-arm64_0.10.1 ] --------------------
101+
2022-12-02 16:12:11 ✔ [SUCCESS] Initialize finished.
102+
```
99103

100104
---
101105

@@ -107,31 +111,31 @@ Run:
107111
./dtm apply -y
108112
```
109113

110-
> You should see similar output to the following
111-
112-
```
113-
2022-12-02 16:18:00 ℹ [INFO] Apply started.
114-
2022-12-02 16:18:00 ℹ [INFO] Using local backend. State file: devstream.state.
115-
2022-12-02 16:18:00 ℹ [INFO] Tool (repo-scaffolding/golang-github) found in config but doesn't exist in the state, will be created.
116-
2022-12-02 16:18:00 ℹ [INFO] Tool (githubactions-golang/default) found in config but doesn't exist in the state, will be created.
117-
2022-12-02 16:18:00 ℹ [INFO] Start executing the plan.
118-
2022-12-02 16:18:00 ℹ [INFO] Changes count: 2.
119-
2022-12-02 16:18:00 ℹ [INFO] -------------------- [ Processing progress: 1/2. ] --------------------
120-
2022-12-02 16:18:00 ℹ [INFO] Processing: (repo-scaffolding/golang-github) -> Create ...
121-
2022-12-02 16:18:00 ℹ [INFO] github start to download repoTemplate...
122-
2022-12-02 16:18:04 ✔ [SUCCESS] The repo go-webapp-devstream-demo has been created.
123-
2022-12-02 16:18:12 ✔ [SUCCESS] Tool (repo-scaffolding/golang-github) Create done.
124-
2022-12-02 16:18:12 ℹ [INFO] -------------------- [ Processing progress: 2/2. ] --------------------
125-
2022-12-02 16:18:12 ℹ [INFO] Processing: (githubactions-golang/default) -> Create ...
126-
2022-12-02 16:18:13 ℹ [INFO] Creating GitHub Actions workflow pr-builder.yml ...
127-
2022-12-02 16:18:14 ✔ [SUCCESS] Github Actions workflow pr-builder.yml created.
128-
2022-12-02 16:18:14 ℹ [INFO] Creating GitHub Actions workflow main-builder.yml ...
129-
2022-12-02 16:18:15 ✔ [SUCCESS] Github Actions workflow main-builder.yml created.
130-
2022-12-02 16:18:15 ✔ [SUCCESS] Tool (githubactions-golang/default) Create done.
131-
2022-12-02 16:18:15 ℹ [INFO] -------------------- [ Processing done. ] --------------------
132-
2022-12-02 16:18:15 ✔ [SUCCESS] All plugins applied successfully.
133-
2022-12-02 16:18:15 ✔ [SUCCESS] Apply finished.
134-
```
114+
!!! success "You should see similar output to the following"
115+
116+
```text title=""
117+
2022-12-02 16:18:00 ℹ [INFO] Apply started.
118+
2022-12-02 16:18:00 ℹ [INFO] Using local backend. State file: devstream.state.
119+
2022-12-02 16:18:00 ℹ [INFO] Tool (repo-scaffolding/golang-github) found in config but doesn't exist in the state, will be created.
120+
2022-12-02 16:18:00 ℹ [INFO] Tool (githubactions-golang/default) found in config but doesn't exist in the state, will be created.
121+
2022-12-02 16:18:00 ℹ [INFO] Start executing the plan.
122+
2022-12-02 16:18:00 ℹ [INFO] Changes count: 2.
123+
2022-12-02 16:18:00 ℹ [INFO] -------------------- [ Processing progress: 1/2. ] --------------------
124+
2022-12-02 16:18:00 ℹ [INFO] Processing: (repo-scaffolding/golang-github) -> Create ...
125+
2022-12-02 16:18:00 ℹ [INFO] github start to download repoTemplate...
126+
2022-12-02 16:18:04 ✔ [SUCCESS] The repo go-webapp-devstream-demo has been created.
127+
2022-12-02 16:18:12 ✔ [SUCCESS] Tool (repo-scaffolding/golang-github) Create done.
128+
2022-12-02 16:18:12 ℹ [INFO] -------------------- [ Processing progress: 2/2. ] --------------------
129+
2022-12-02 16:18:12 ℹ [INFO] Processing: (githubactions-golang/default) -> Create ...
130+
2022-12-02 16:18:13 ℹ [INFO] Creating GitHub Actions workflow pr-builder.yml ...
131+
2022-12-02 16:18:14 ✔ [SUCCESS] Github Actions workflow pr-builder.yml created.
132+
2022-12-02 16:18:14 ℹ [INFO] Creating GitHub Actions workflow main-builder.yml ...
133+
2022-12-02 16:18:15 ✔ [SUCCESS] Github Actions workflow main-builder.yml created.
134+
2022-12-02 16:18:15 ✔ [SUCCESS] Tool (githubactions-golang/default) Create done.
135+
2022-12-02 16:18:15 ℹ [INFO] -------------------- [ Processing done. ] --------------------
136+
2022-12-02 16:18:15 ✔ [SUCCESS] All plugins applied successfully.
137+
2022-12-02 16:18:15 ✔ [SUCCESS] Apply finished.
138+
```
135139

136140
---
137141

@@ -157,33 +161,35 @@ Run:
157161

158162
Input `y` then press enter to continue, and you should see similar output:
159163

160-
```
161-
2022-12-02 16:19:07 ℹ [INFO] Delete started.
162-
2022-12-02 16:19:07 ℹ [INFO] Using local backend. State file: devstream.state.
163-
2022-12-02 16:19:07 ℹ [INFO] Tool (githubactions-golang/default) will be deleted.
164-
2022-12-02 16:19:07 ℹ [INFO] Tool (repo-scaffolding/golang-github) will be deleted.
165-
Continue? [y/n]
166-
Enter a value (Default is n): y
167-
168-
2022-12-02 16:19:08 ℹ [INFO] Start executing the plan.
169-
2022-12-02 16:19:08 ℹ [INFO] Changes count: 2.
170-
2022-12-02 16:19:08 ℹ [INFO] -------------------- [ Processing progress: 1/2. ] --------------------
171-
2022-12-02 16:19:08 ℹ [INFO] Processing: (githubactions-golang/default) -> Delete ...
172-
2022-12-02 16:19:09 ℹ [INFO] Deleting GitHub Actions workflow pr-builder.yml ...
173-
2022-12-02 16:19:09 ✔ [SUCCESS] GitHub Actions workflow pr-builder.yml removed.
174-
2022-12-02 16:19:10 ℹ [INFO] Deleting GitHub Actions workflow main-builder.yml ...
175-
2022-12-02 16:19:10 ✔ [SUCCESS] GitHub Actions workflow main-builder.yml removed.
176-
2022-12-02 16:19:10 ℹ [INFO] Prepare to delete 'githubactions-golang_default' from States.
177-
2022-12-02 16:19:10 ✔ [SUCCESS] Tool (githubactions-golang/default) delete done.
178-
2022-12-02 16:19:10 ℹ [INFO] -------------------- [ Processing progress: 2/2. ] --------------------
179-
2022-12-02 16:19:10 ℹ [INFO] Processing: (repo-scaffolding/golang-github) -> Delete ...
180-
2022-12-02 16:19:11 ✔ [SUCCESS] GitHub repo go-webapp-devstream-demo removed.
181-
2022-12-02 16:19:11 ℹ [INFO] Prepare to delete 'repo-scaffolding_golang-github' from States.
182-
2022-12-02 16:19:11 ✔ [SUCCESS] Tool (repo-scaffolding/golang-github) delete done.
183-
2022-12-02 16:19:11 ℹ [INFO] -------------------- [ Processing done. ] --------------------
184-
2022-12-02 16:19:11 ✔ [SUCCESS] All plugins deleted successfully.
185-
2022-12-02 16:19:11 ✔ [SUCCESS] Delete finished.
186-
```
164+
!!! success "Output"
165+
166+
```text title=""
167+
2022-12-02 16:19:07 ℹ [INFO] Delete started.
168+
2022-12-02 16:19:07 ℹ [INFO] Using local backend. State file: devstream.state.
169+
2022-12-02 16:19:07 ℹ [INFO] Tool (githubactions-golang/default) will be deleted.
170+
2022-12-02 16:19:07 ℹ [INFO] Tool (repo-scaffolding/golang-github) will be deleted.
171+
Continue? [y/n]
172+
Enter a value (Default is n): y
173+
174+
2022-12-02 16:19:08 ℹ [INFO] Start executing the plan.
175+
2022-12-02 16:19:08 ℹ [INFO] Changes count: 2.
176+
2022-12-02 16:19:08 ℹ [INFO] -------------------- [ Processing progress: 1/2. ] --------------------
177+
2022-12-02 16:19:08 ℹ [INFO] Processing: (githubactions-golang/default) -> Delete ...
178+
2022-12-02 16:19:09 ℹ [INFO] Deleting GitHub Actions workflow pr-builder.yml ...
179+
2022-12-02 16:19:09 ✔ [SUCCESS] GitHub Actions workflow pr-builder.yml removed.
180+
2022-12-02 16:19:10 ℹ [INFO] Deleting GitHub Actions workflow main-builder.yml ...
181+
2022-12-02 16:19:10 ✔ [SUCCESS] GitHub Actions workflow main-builder.yml removed.
182+
2022-12-02 16:19:10 ℹ [INFO] Prepare to delete 'githubactions-golang_default' from States.
183+
2022-12-02 16:19:10 ✔ [SUCCESS] Tool (githubactions-golang/default) delete done.
184+
2022-12-02 16:19:10 ℹ [INFO] -------------------- [ Processing progress: 2/2. ] --------------------
185+
2022-12-02 16:19:10 ℹ [INFO] Processing: (repo-scaffolding/golang-github) -> Delete ...
186+
2022-12-02 16:19:11 ✔ [SUCCESS] GitHub repo go-webapp-devstream-demo removed.
187+
2022-12-02 16:19:11 ℹ [INFO] Prepare to delete 'repo-scaffolding_golang-github' from States.
188+
2022-12-02 16:19:11 ✔ [SUCCESS] Tool (repo-scaffolding/golang-github) delete done.
189+
2022-12-02 16:19:11 ℹ [INFO] -------------------- [ Processing done. ] --------------------
190+
2022-12-02 16:19:11 ✔ [SUCCESS] All plugins deleted successfully.
191+
2022-12-02 16:19:11 ✔ [SUCCESS] Delete finished.
192+
```
187193

188194
Now if you check your GitHub repo list again, everything has been nuked by DevStream. Hooray!
189195

0 commit comments

Comments
 (0)