juzhiyuan commented on a change in pull request #729:
URL: https://github.com/apache/apisix-dashboard/pull/729#discussion_r519643314
##########
File path: Makefile
##########
@@ -17,26 +17,58 @@
SHELL := /bin/bash -o pipefail
UNAME ?= $(shell uname)
+YARN_EXEC ?= $(shell which yarn)
+GO_EXEC ?= $(shell which go)
-### help: Show Makefile rules
+export GO111MODULE=on
+
+### help: Show Makefile rules
.PHONY: help
help:
@echo Makefile rules:
@echo
@grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /'
-export GO111MODULE=on
-### license-check: Check apisix-dashboard source codes for Apache License
-.PHONY: license-check
-license-check:
-ifeq ("$(wildcard .actions/openwhisk-utilities/scancode/scanCode.py)", "")
- git clone https://github.com/apache/openwhisk-utilities.git
.actions/openwhisk-utilities
- cp .actions/ASF* .actions/openwhisk-utilities/scancode/
+### build: build dashboard, it contains web and manager-api
+.PHONY: build
+build: web-default api-default
+ api/build.sh && cd /web && yarn install && yarn build
+
+
+.PHONY: web-default
+web-default:
+ifeq ("$(wildcard $(YARN_EXEC))", "")
+ @echo "ERROR: Need to install yarn first"
+ exit 1
endif
- .actions/openwhisk-utilities/scancode/scanCode.py --config
.actions/ASF-Release.cfg ./
-### golang-lint: Lint Go source code
+
+.PHONY: api-default
+api-default:
+ifeq ("$(wildcard $(GO_EXEC))", "")
+ @echo "ERROR: Need to install golang 1.13+ first"
+ exit 1
+endif
+
+
+### api-test: Run the tests of manager-api
+.PHONY: api-test
+api-test: api-default
+ cd api/ && APISIX_API_WORKDIR=$$PWD go test -v -race -cover
-coverprofile=coverage.txt -covermode=atomic ./...
+
+
+### api-run: Run the manager-api
+.PHONY: api-run
+api-run: api-default
+ cd api/ && go run .
+
+### api-stop: stop manager-api
Review comment:
`S`
##########
File path: Makefile
##########
@@ -17,26 +17,58 @@
SHELL := /bin/bash -o pipefail
UNAME ?= $(shell uname)
+YARN_EXEC ?= $(shell which yarn)
+GO_EXEC ?= $(shell which go)
-### help: Show Makefile rules
+export GO111MODULE=on
+
+### help: Show Makefile rules
.PHONY: help
help:
@echo Makefile rules:
@echo
@grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /'
-export GO111MODULE=on
-### license-check: Check apisix-dashboard source codes for Apache License
-.PHONY: license-check
-license-check:
-ifeq ("$(wildcard .actions/openwhisk-utilities/scancode/scanCode.py)", "")
- git clone https://github.com/apache/openwhisk-utilities.git
.actions/openwhisk-utilities
- cp .actions/ASF* .actions/openwhisk-utilities/scancode/
+### build: build dashboard, it contains web and manager-api
+.PHONY: build
+build: web-default api-default
+ api/build.sh && cd /web && yarn install && yarn build
+
+
+.PHONY: web-default
+web-default:
+ifeq ("$(wildcard $(YARN_EXEC))", "")
+ @echo "ERROR: Need to install yarn first"
+ exit 1
endif
- .actions/openwhisk-utilities/scancode/scanCode.py --config
.actions/ASF-Release.cfg ./
-### golang-lint: Lint Go source code
+
+.PHONY: api-default
+api-default:
+ifeq ("$(wildcard $(GO_EXEC))", "")
+ @echo "ERROR: Need to install golang 1.13+ first"
+ exit 1
+endif
+
+
+### api-test: Run the tests of manager-api
+.PHONY: api-test
+api-test: api-default
+ cd api/ && APISIX_API_WORKDIR=$$PWD go test -v -race -cover
-coverprofile=coverage.txt -covermode=atomic ./...
+
+
+### api-run: Run the manager-api
+.PHONY: api-run
+api-run: api-default
+ cd api/ && go run .
+
+### api-stop: stop manager-api
+api-stop:
+ kill $(ps aux | grep 'manager-api' | awk '{print $2}')
+
+
+### golang-lint: Lint Go source code
Review comment:
`golang-lint` with `Go`?
##########
File path: Makefile
##########
@@ -46,8 +78,13 @@ golang-lint: ## Run the golangci-lint application (install
if not found)
@echo "running golangci-lint..."
@cd api && golangci-lint run --tests=false ./...
-### api-test: Run the tests of manager-api
-.PHONY: api-test
-api-test:
- cd api/ && APISIX_API_WORKDIR=$$PWD go test -v -race -cover
-coverprofile=coverage.txt -covermode=atomic ./...
+
+### license-check: Check apisix-dashboard source codes for Apache License
+.PHONY: license-check
+license-check:
+ifeq ("$(wildcard .actions/openwhisk-utilities/scancode/scanCode.py)", "")
+ git clone https://github.com/apache/openwhisk-utilities.git
.actions/openwhisk-utilities
Review comment:
Then could we remove those files from source codes?
##########
File path: README.md
##########
@@ -23,19 +23,27 @@ English | [简体中文](./README.zh-CN.md)
Dashboard for [Apache APISIX](https://github.com/apache/apisix)
+The goal of the Apache APISIX Dashboard project is to enable everyone to
quickly experience and learn Apache APISIX, and it cannot be used directly in a
production environment. Therefore, its function point coverage is always a
subset of Apache APISIX, and may lag behind the rapid iteration of Apache
APISIX. If you need to use the Dashboard project in a production system, you
need to enhance user permissions, communication security, high availability and
advanced features.
Review comment:

##########
File path: README.md
##########
@@ -23,19 +23,27 @@ English | [简体中文](./README.zh-CN.md)
Dashboard for [Apache APISIX](https://github.com/apache/apisix)
+The goal of the Apache APISIX Dashboard project is to enable everyone to
quickly experience and learn Apache APISIX, and it cannot be used directly in a
production environment. Therefore, its function point coverage is always a
subset of Apache APISIX, and may lag behind the rapid iteration of Apache
APISIX. If you need to use the Dashboard project in a production system, you
need to enhance user permissions, communication security, high availability and
advanced features.
+
## User Guide
Please refer to [User Guide](./docs/USER_GUIDE.md)
-## Deployment
+## For Developer
+
+If you are a developer, please refer to start manager-api and Web separately
+
+- [dependencies](#dependencies)
+- [develop Dashboard](./docs/develop.md)
+
+## deployment
-- [Deploy Manually](./docs/deploy.md)
-- [Deploy with Docker](./docs/deploy-with-docker.md)
+- [one click with Docker](./docs/deploy-with-docker.md)
Review comment:
Why add `one click`?
##########
File path: README.md
##########
@@ -23,19 +23,27 @@ English | [简体中文](./README.zh-CN.md)
Dashboard for [Apache APISIX](https://github.com/apache/apisix)
+The goal of the Apache APISIX Dashboard project is to enable everyone to
quickly experience and learn Apache APISIX, and it cannot be used directly in a
production environment. Therefore, its function point coverage is always a
subset of Apache APISIX, and may lag behind the rapid iteration of Apache
APISIX. If you need to use the Dashboard project in a production system, you
need to enhance user permissions, communication security, high availability and
advanced features.
+
## User Guide
Please refer to [User Guide](./docs/USER_GUIDE.md)
-## Deployment
+## For Developer
+
+If you are a developer, please refer to start manager-api and Web separately
+
+- [dependencies](#dependencies)
+- [develop Dashboard](./docs/develop.md)
+
+## deployment
Review comment:

##########
File path: README.zh-CN.md
##########
@@ -21,23 +21,30 @@
# [Apache APISIX](https://github.com/apache/apisix) 控制台
+Apache APISIX Dashboard 项目的目标是为了让大家快速上手体验和学习 Apache
APISIX,并不能直接用于生产环境。所以它的功能点覆盖永远都是 Apache APISIX 的子集,也可能会滞后于 Apache APISIX
的快速迭代。如果你需要把 Dashboard 项目用于生产系统,需要对用户权限、通讯安全、高可用、高级功能等方面做增强。
+
## 用户指南
请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)
-## 部署
+## 开发者
+
+如果你是开发者,请参考这里分别启动 manager-api 和 web
Review comment:
`对于开发者`
##########
File path: README.zh-CN.md
##########
@@ -21,23 +21,30 @@
# [Apache APISIX](https://github.com/apache/apisix) 控制台
+Apache APISIX Dashboard 项目的目标是为了让大家快速上手体验和学习 Apache
APISIX,并不能直接用于生产环境。所以它的功能点覆盖永远都是 Apache APISIX 的子集,也可能会滞后于 Apache APISIX
的快速迭代。如果你需要把 Dashboard 项目用于生产系统,需要对用户权限、通讯安全、高可用、高级功能等方面做增强。
+
## 用户指南
请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)
-## 部署
+## 开发者
+
+如果你是开发者,请参考这里分别启动 manager-api 和 web
+
+- [依赖检查](#依赖检查)
+- [开发 Dashboard](./docs/develop.zh-CN.md)
+
+## 部署运行
-当前支持如下方式部署:
+我们有多种部署方式
-- [手动部署](./docs/deploy.zh-CN.md)
-- [使用 Docker 部署](./docs/deploy-with-docker.zh-CN.md)
+- [使用 Docker 一键部署](./docs/deploy-with-docker.zh-CN.md)
-## 开发
+- [从源文件打包部署](./docs/deploy.zh-CN.md)
-开发分为 Apache APISIX 开发、Dashboard 开发
+## 依赖检查
-- [Apache APISIX](https://github.com/apache/apisix)
-- [Dashboard](./docs/develop.zh-CN.md)
+apisix-dashboard 为 [Apache APISIX](https://github.com/apache/apisix)
提供管理界面,需要先 [安装
APISIX](https://github.com/apache/apisix#configure-and-installation).
Review comment:

##########
File path: README.zh-CN.md
##########
@@ -21,23 +21,30 @@
# [Apache APISIX](https://github.com/apache/apisix) 控制台
+Apache APISIX Dashboard 项目的目标是为了让大家快速上手体验和学习 Apache
APISIX,并不能直接用于生产环境。所以它的功能点覆盖永远都是 Apache APISIX 的子集,也可能会滞后于 Apache APISIX
的快速迭代。如果你需要把 Dashboard 项目用于生产系统,需要对用户权限、通讯安全、高可用、高级功能等方面做增强。
+
## 用户指南
请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)
-## 部署
+## 开发者
+
+如果你是开发者,请参考这里分别启动 manager-api 和 web
+
+- [依赖检查](#依赖检查)
+- [开发 Dashboard](./docs/develop.zh-CN.md)
+
+## 部署运行
-当前支持如下方式部署:
+我们有多种部署方式
-- [手动部署](./docs/deploy.zh-CN.md)
-- [使用 Docker 部署](./docs/deploy-with-docker.zh-CN.md)
+- [使用 Docker 一键部署](./docs/deploy-with-docker.zh-CN.md)
-## 开发
+- [从源文件打包部署](./docs/deploy.zh-CN.md)
Review comment:
This should be the first than Deploy with Docker
##########
File path: README.zh-CN.md
##########
@@ -21,23 +21,30 @@
# [Apache APISIX](https://github.com/apache/apisix) 控制台
+Apache APISIX Dashboard 项目的目标是为了让大家快速上手体验和学习 Apache
APISIX,并不能直接用于生产环境。所以它的功能点覆盖永远都是 Apache APISIX 的子集,也可能会滞后于 Apache APISIX
的快速迭代。如果你需要把 Dashboard 项目用于生产系统,需要对用户权限、通讯安全、高可用、高级功能等方面做增强。
+
## 用户指南
请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)
-## 部署
+## 开发者
+
+如果你是开发者,请参考这里分别启动 manager-api 和 web
+
+- [依赖检查](#依赖检查)
+- [开发 Dashboard](./docs/develop.zh-CN.md)
+
+## 部署运行
-当前支持如下方式部署:
+我们有多种部署方式
Review comment:
`支持`
##########
File path: README.zh-CN.md
##########
@@ -21,23 +21,30 @@
# [Apache APISIX](https://github.com/apache/apisix) 控制台
+Apache APISIX Dashboard 项目的目标是为了让大家快速上手体验和学习 Apache
APISIX,并不能直接用于生产环境。所以它的功能点覆盖永远都是 Apache APISIX 的子集,也可能会滞后于 Apache APISIX
的快速迭代。如果你需要把 Dashboard 项目用于生产系统,需要对用户权限、通讯安全、高可用、高级功能等方面做增强。
+
## 用户指南
请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)
-## 部署
+## 开发者
+
+如果你是开发者,请参考这里分别启动 manager-api 和 web
+
+- [依赖检查](#依赖检查)
+- [开发 Dashboard](./docs/develop.zh-CN.md)
+
+## 部署运行
Review comment:

##########
File path: docs/deploy.md
##########
@@ -37,51 +39,32 @@ NOTE: You also need to install `Lua` 5.1+ if you want to
use the Plugin Orchestr
2. Check environment variables
-- enable Go MODULE
-
-```sh
-$ go env -w GO111MODULE=on
-```
-
- For most users in China, we could use [Goproxy](https://goproxy.cn/) to
speed up downloading modules.
```sh
$ go env -w GOPROXY=https://goproxy.cn,direct
```
-3. Build
-
-```sh
-$ api/build.sh
-```
-
The bundled files are located in the root directory `/output`.
-## Build the web
+### web dependencies
Review comment:
uppercase
##########
File path: README.zh-CN.md
##########
@@ -21,23 +21,30 @@
# [Apache APISIX](https://github.com/apache/apisix) 控制台
+Apache APISIX Dashboard 项目的目标是为了让大家快速上手体验和学习 Apache
APISIX,并不能直接用于生产环境。所以它的功能点覆盖永远都是 Apache APISIX 的子集,也可能会滞后于 Apache APISIX
的快速迭代。如果你需要把 Dashboard 项目用于生产系统,需要对用户权限、通讯安全、高可用、高级功能等方面做增强。
+
## 用户指南
请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)
-## 部署
+## 开发者
+
+如果你是开发者,请参考这里分别启动 manager-api 和 web
+
+- [依赖检查](#依赖检查)
+- [开发 Dashboard](./docs/develop.zh-CN.md)
+
+## 部署运行
-当前支持如下方式部署:
+我们有多种部署方式
-- [手动部署](./docs/deploy.zh-CN.md)
-- [使用 Docker 部署](./docs/deploy-with-docker.zh-CN.md)
+- [使用 Docker 一键部署](./docs/deploy-with-docker.zh-CN.md)
-## 开发
+- [从源文件打包部署](./docs/deploy.zh-CN.md)
Review comment:
and Build, Deploy, and Run is not the same at all.
##########
File path: docs/deploy.md
##########
@@ -104,14 +87,29 @@ authentication:
password: user
```
-2. Run manager-api
+2. Run
```sh
-$ api/run.sh &
+$ cd ./output
+$ export ENV=local && exec ./manager-api
```
3. Visit `http://127.0.0.1:8080` in your browser, `8080` is the default listen
port of manager-api.
+3. stop
+
+```sh
+$ kill $(ps aux | grep 'manager-api' | awk '{print $2}')
+```
+
+## tar
+
+You can package the output directory as a whole, copy it to other places to
decompress and run. The output directory contains all the files needed to run
the dashboard (configuration files, executable files, web static resources)
Review comment:
`.`
##########
File path: docs/deploy.md
##########
@@ -104,14 +87,29 @@ authentication:
password: user
```
-2. Run manager-api
+2. Run
```sh
-$ api/run.sh &
+$ cd ./output
+$ export ENV=local && exec ./manager-api
```
3. Visit `http://127.0.0.1:8080` in your browser, `8080` is the default listen
port of manager-api.
+3. stop
+
+```sh
+$ kill $(ps aux | grep 'manager-api' | awk '{print $2}')
+```
+
+## tar
+
+You can package the output directory as a whole, copy it to other places to
decompress and run. The output directory contains all the files needed to run
the dashboard (configuration files, executable files, web static resources)
Review comment:
to other places and decompress then run
##########
File path: README.zh-CN.md
##########
@@ -21,23 +21,30 @@
# [Apache APISIX](https://github.com/apache/apisix) 控制台
+Apache APISIX Dashboard 项目的目标是为了让大家快速上手体验和学习 Apache
APISIX,并不能直接用于生产环境。所以它的功能点覆盖永远都是 Apache APISIX 的子集,也可能会滞后于 Apache APISIX
的快速迭代。如果你需要把 Dashboard 项目用于生产系统,需要对用户权限、通讯安全、高可用、高级功能等方面做增强。
+
## 用户指南
请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)
-## 部署
+## 开发者
+
+如果你是开发者,请参考这里分别启动 manager-api 和 web
+
+- [依赖检查](#依赖检查)
Review comment:
It should be serial here, not parallel.
##########
File path: docs/deploy.md
##########
@@ -37,51 +39,32 @@ NOTE: You also need to install `Lua` 5.1+ if you want to
use the Plugin Orchestr
2. Check environment variables
-- enable Go MODULE
-
-```sh
-$ go env -w GO111MODULE=on
-```
-
- For most users in China, we could use [Goproxy](https://goproxy.cn/) to
speed up downloading modules.
```sh
$ go env -w GOPROXY=https://goproxy.cn,direct
```
-3. Build
-
-```sh
-$ api/build.sh
-```
-
The bundled files are located in the root directory `/output`.
-## Build the web
+### web dependencies
This project is initialized with [Ant Design Pro](https://pro.ant.design). The
following are some quick guides for how to use.
1. Make sure you have `Node.js(version 10.0.0+)` installed on your machine.
2. Install [yarn](https://yarnpkg.com/).
-3. Install dependencies:
-
-```sh
-$ cd /web
-
-$ yarn install
-```
-4. Build
+### building
Review comment:
What's building??
##########
File path: docs/deploy.zh-CN.md
##########
@@ -17,7 +17,7 @@
#
Review comment:
check all contents just like in English.
##########
File path: docs/deploy.md
##########
@@ -104,14 +87,29 @@ authentication:
password: user
```
-2. Run manager-api
+2. Run
```sh
-$ api/run.sh &
+$ cd ./output
+$ export ENV=local && exec ./manager-api
Review comment:
ENV = local???
##########
File path: docs/deploy.md
##########
@@ -104,14 +87,29 @@ authentication:
password: user
```
-2. Run manager-api
+2. Run
```sh
-$ api/run.sh &
+$ cd ./output
+$ export ENV=local && exec ./manager-api
```
3. Visit `http://127.0.0.1:8080` in your browser, `8080` is the default listen
port of manager-api.
+3. stop
+
+```sh
+$ kill $(ps aux | grep 'manager-api' | awk '{print $2}')
+```
+
+## tar
+
+You can package the output directory as a whole, copy it to other places to
decompress and run. The output directory contains all the files needed to run
the dashboard (configuration files, executable files, web static resources)
Review comment:
as a whole what?
##########
File path: Makefile
##########
@@ -17,26 +17,58 @@
SHELL := /bin/bash -o pipefail
UNAME ?= $(shell uname)
+YARN_EXEC ?= $(shell which yarn)
+GO_EXEC ?= $(shell which go)
-### help: Show Makefile rules
+export GO111MODULE=on
+
+### help: Show Makefile rules
.PHONY: help
help:
@echo Makefile rules:
@echo
@grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /'
-export GO111MODULE=on
-### license-check: Check apisix-dashboard source codes for Apache License
-.PHONY: license-check
-license-check:
-ifeq ("$(wildcard .actions/openwhisk-utilities/scancode/scanCode.py)", "")
- git clone https://github.com/apache/openwhisk-utilities.git
.actions/openwhisk-utilities
- cp .actions/ASF* .actions/openwhisk-utilities/scancode/
+### build: build dashboard, it contains web and manager-api
+.PHONY: build
+build: web-default api-default
+ api/build.sh && cd /web && yarn install && yarn build
+
+
+.PHONY: web-default
+web-default:
+ifeq ("$(wildcard $(YARN_EXEC))", "")
+ @echo "ERROR: Need to install yarn first"
+ exit 1
endif
- .actions/openwhisk-utilities/scancode/scanCode.py --config
.actions/ASF-Release.cfg ./
-### golang-lint: Lint Go source code
+
+.PHONY: api-default
+api-default:
+ifeq ("$(wildcard $(GO_EXEC))", "")
+ @echo "ERROR: Need to install golang 1.13+ first"
+ exit 1
+endif
+
+
+### api-test: Run the tests of manager-api
+.PHONY: api-test
+api-test: api-default
+ cd api/ && APISIX_API_WORKDIR=$$PWD go test -v -race -cover
-coverprofile=coverage.txt -covermode=atomic ./...
+
+
+### api-run: Run the manager-api
+.PHONY: api-run
+api-run: api-default
+ cd api/ && go run .
+
+### api-stop: stop manager-api
Review comment:

##########
File path: docs/deploy.md
##########
@@ -104,14 +87,29 @@ authentication:
password: user
```
-2. Run manager-api
+2. Run
```sh
-$ api/run.sh &
+$ cd ./output
+$ export ENV=local && exec ./manager-api
```
3. Visit `http://127.0.0.1:8080` in your browser, `8080` is the default listen
port of manager-api.
+3. stop
+
+```sh
+$ kill $(ps aux | grep 'manager-api' | awk '{print $2}')
+```
+
+## tar
Review comment:

Seriously?
##########
File path: docs/deploy.md
##########
@@ -27,7 +27,9 @@ $ git clone -b v2.0
https://github.com/apache/apisix-dashboard.git
$ cd apisix-dashboard
```
-## Build the manager-api
+## build
Review comment:
uppercase
##########
File path: docs/deploy.md
##########
@@ -27,7 +27,9 @@ $ git clone -b v2.0
https://github.com/apache/apisix-dashboard.git
$ cd apisix-dashboard
```
-## Build the manager-api
+## build
+
+### manager-api dependencies
Review comment:
uppercase
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]