You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/09 00:54:00 UTC

[GitHub] [apisix-dashboard] membphis commented on a change in pull request #729: docs: add makefile && modify develop and deploy docs

membphis commented on a change in pull request #729:
URL: https://github.com/apache/apisix-dashboard/pull/729#discussion_r519502901



##########
File path: Makefile
##########
@@ -46,8 +84,26 @@ 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
+### api-test:         Run the tests of manager-api 
 .PHONY: api-test
-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

Review comment:
       we can find `run`, where is the `stop`?
   They should work together.

##########
File path: Makefile
##########
@@ -46,8 +84,26 @@ 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
+### api-test:         Run the tests of manager-api 
 .PHONY: api-test
-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 .
+
+### 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/
+endif
+	.actions/openwhisk-utilities/scancode/scanCode.py --config .actions/ASF-Release.cfg ./
+
+

Review comment:
       code style: only one blank line at the end of file

##########
File path: Makefile
##########
@@ -25,16 +29,50 @@ help:
 	@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/
+### dashboard-build:   build dashboard, it contains frontend and manager-api
+.PHONY: dashboard-build
+dashboard-build: frontend-default api-default
+	api/build.sh; \
+	cd /web; \
+	yarn install; \
+	yarn build
+
+### dashboard-run:   run dashboard, it contains frontend and manager-api

Review comment:
       two blank lines between different command

##########
File path: docs/deploy.zh-CN.md
##########
@@ -37,53 +39,33 @@ $ cd apisix-dashboard
 
 2. 检查环境变量
 
-- 开启 Go MODULE
-
-```sh
-$ go env -w GO111MODULE=on
-```
-
 - 对于大多数中国用户,我们可以使用 [Goproxy](https://goproxy.cn/) 加快模块下载速度。
 
 ```sh
 $ go env -w GOPROXY=https://goproxy.cn,direct
 ```
 
-3. 构建
-
-```sh
-$ api/build.sh
-```
-
-构建完成后的文件在根目录 `/output` 下。
-
-## 构建前端
+### 前端 检查项
 
 该项目使用 [Ant Design Pro](https://pro.ant.design) 初始化。以下是一些使用方法的快速指南。
 
 1. 确保你的设备已经安装了 `Node.js(版本 10.0.0+)`。
 
 2. 安装 [yarn](https://yarnpkg.com/)。
 
-3. 安装依赖:
 
-```sh
-$ cd /web
+### 开始构建
 
-$ yarn install
-```
-
-4. 构建
 
 ```sh
-$ yarn build
+$ make dashboard-build
 ```
 
-构建完成后的文件在根目录 `/output/html` 目录下。
+构建完成后的文件在根目录 `/output` 下。

Review comment:
       we'll use `build` instead of `output`, all right?

##########
File path: Makefile
##########
@@ -46,8 +84,26 @@ 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
+### api-test:         Run the tests of manager-api 
 .PHONY: api-test
-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 .
+
+### 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/
+endif
+	.actions/openwhisk-utilities/scancode/scanCode.py --config .actions/ASF-Release.cfg ./
+
+

Review comment:
       you can call `make help`, text output should be aligned

##########
File path: docs/deploy.zh-CN.md
##########
@@ -37,53 +39,33 @@ $ cd apisix-dashboard
 
 2. 检查环境变量
 
-- 开启 Go MODULE
-
-```sh
-$ go env -w GO111MODULE=on
-```
-
 - 对于大多数中国用户,我们可以使用 [Goproxy](https://goproxy.cn/) 加快模块下载速度。
 
 ```sh
 $ go env -w GOPROXY=https://goproxy.cn,direct
 ```
 
-3. 构建
-
-```sh
-$ api/build.sh
-```
-
-构建完成后的文件在根目录 `/output` 下。
-
-## 构建前端
+### 前端 检查项
 
 该项目使用 [Ant Design Pro](https://pro.ant.design) 初始化。以下是一些使用方法的快速指南。
 
 1. 确保你的设备已经安装了 `Node.js(版本 10.0.0+)`。
 
 2. 安装 [yarn](https://yarnpkg.com/)。
 
-3. 安装依赖:
 
-```sh
-$ cd /web
+### 开始构建
 
-$ yarn install
-```
-
-4. 构建
 
 ```sh
-$ yarn build
+$ make dashboard-build
 ```
 
-构建完成后的文件在根目录 `/output/html` 目录下。
+构建完成后的文件在根目录 `/output` 下。
 
 ## 启动
 
-1. 根据您的部署环境,检查并修改 `api/conf/conf.yaml` 中的配置。
+1. 根据您的部署环境,检查并修改 `output/conf/conf.yaml` 中的配置。

Review comment:
       we can remove the `output/` here.

##########
File path: Makefile
##########
@@ -46,8 +84,26 @@ 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
+### api-test:         Run the tests of manager-api 
 .PHONY: api-test
-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 .
+
+### 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/
+endif
+	.actions/openwhisk-utilities/scancode/scanCode.py --config .actions/ASF-Release.cfg ./
+
+

Review comment:
       we should implement the `make run`, `make stop`, `make build` first




----------------------------------------------------------------
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:
users@infra.apache.org