Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add makefile && modify develop and deploy docs #729

Merged
merged 35 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
17046f3
docs: add makefile && modify develop and deploy docs
gxthrj Nov 8, 2020
5a03170
docs: Make the makefile clearer
gxthrj Nov 9, 2020
53d86b0
docs: modify frontend to web
gxthrj Nov 9, 2020
3e33977
doc: two blankline between commands
gxthrj Nov 9, 2020
453246d
doc: remove blanklien EOF
gxthrj Nov 9, 2020
ec1bd03
docs: remove make run/stop in makefile
gxthrj Nov 9, 2020
e42651f
docs: make readme readable
gxthrj Nov 9, 2020
ce81ec9
docs: declear in readme
gxthrj Nov 9, 2020
2d9189c
docs: make readme readable
gxthrj Nov 9, 2020
61dc416
docs: remove dependencies in readme
gxthrj Nov 9, 2020
c62aecd
docs: check english desc
gxthrj Nov 9, 2020
d243dd6
docs: style adjust
gxthrj Nov 9, 2020
773168a
docs: sync makefile desc
gxthrj Nov 9, 2020
6fde9e4
docs: remove blank
gxthrj Nov 9, 2020
59c20ac
docs: style adjust
gxthrj Nov 9, 2020
f1f94f8
docs: remove ENV=local in deploy
gxthrj Nov 9, 2020
4ea4dfe
fix: modify lint ci
gxthrj Nov 9, 2020
85c9ace
docs: unify go-lint
gxthrj Nov 10, 2020
e02874e
docs: check all text
gxthrj Nov 10, 2020
3e2e585
docs: makefile Aligned
gxthrj Nov 10, 2020
a20ec8e
docs: update style
gxthrj Nov 10, 2020
a61879e
docs: add markdown code style
gxthrj Nov 10, 2020
c7040f3
docs: fix syntax
gxthrj Nov 10, 2020
a8b55f1
docs: remove Self-referencing
gxthrj Nov 10, 2020
28b1316
docs: user guide
gxthrj Nov 10, 2020
38decac
docs: use header
gxthrj Nov 10, 2020
0312f50
docs: style fix
gxthrj Nov 10, 2020
59e60cc
docs: add desc
gxthrj Nov 10, 2020
dc93d15
docs: modify 'pack' to 'package'
gxthrj Nov 10, 2020
e1c3e5c
docs: unify manager-api
gxthrj Nov 10, 2020
3660e99
docs: mv Install to Installation
gxthrj Nov 10, 2020
f894cd9
docs: node to Node.js
gxthrj Nov 10, 2020
629efc7
docs: source codes to Source Codes
gxthrj Nov 10, 2020
68e8424
docs: Source Codes
gxthrj Nov 10, 2020
50b9c27
fix: mkdir -p ./output/logs in makefile build
gxthrj Nov 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 51 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved
.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
gxthrj marked this conversation as resolved.
Show resolved Hide resolved
api-stop:
kill $(ps aux | grep 'manager-api' | awk '{print $2}')


### golang-lint: Lint Go source code
gxthrj marked this conversation as resolved.
Show resolved Hide resolved
.PHONY: golang-lint
golang-lint: ## Run the golangci-lint application (install if not found)
@#Brew - MacOS
Expand All @@ -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
gxthrj marked this conversation as resolved.
Show resolved Hide resolved
cp .actions/ASF* .actions/openwhisk-utilities/scancode/
endif
.actions/openwhisk-utilities/scancode/scanCode.py --config .actions/ASF-Release.cfg ./

71 changes: 63 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,70 @@ English | [简体中文](./README.zh-CN.md)

Dashboard for [Apache APISIX](https://github.com/apache/apisix)

## User Guide
The goal of the Apache APISIX Dashboard project is to enable everyone to quickly experience and learn Apache APISIX, and it still cannot be used directly in a production environment. 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 other advanced features.
gxthrj marked this conversation as resolved.
Show resolved Hide resolved

Please refer to [User Guide](./docs/USER_GUIDE.md)
## Install
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved

We have multiple ways to install APISIX dashboard
gxthrj marked this conversation as resolved.
Show resolved Hide resolved

### Docker

We can start a runnable version by the following method

- [one click with Docker](./docs/deploy-with-docker.md)

### Build from source code

To build from source code, first make sure that your `golang` version is 1.13 or greater.
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved
Also you need to follow the `node` and `yarn` in advance
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved

```
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved
$ git clone -b v2.0 https://github.com/apache/apisix-dashboard.git && cd apisix-dashboard
$ make build
```

Then you can find all files (configuration files, executable files, web static resources) needed to run dashboard in the `./output` directory.

Start by the following command
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved

```sh
$ cd ./output
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved
$ export ENV=local && exec ./manager-api
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved
```

`makefile` provides the following commands

## Deployment
```
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved
Makefile rules:

- [Deploy Manually](./docs/deploy.md)
- [Deploy with Docker](./docs/deploy-with-docker.md)
help: Show Makefile rules
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved
build: build dashboard, it contains web and manager-api
api-test: Run the tests of manager-api
api-run: Run the manager-api
api-stop: stop manager-api
golang-lint: Lint Go source code
license-check: Check apisix-dashboard source codes for Apache License
```

## Development
For more detailed construction steps, see - [build from source code](./docs/deploy.md)

- [Apache APISIX](https://github.com/apache/apisix)
- [Dashboard](./docs/develop.md)
### For developer

apisix-dashboard provides a management interface for [Apache APISIX](https://github.com/apache/apisix), you need to [install APISIX first](https://github.com/apache/apisix#configure-and-installation).
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved

then, please refer to here to start `manager-api` and `web`respectively.

- [dependencies](#dependencies)
gxthrj marked this conversation as resolved.
Show resolved Hide resolved

- [develop Dashboard](./docs/develop.md)

## dependencies


juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved

## Dashboard user guide

Please refer to [User Guide](./docs/USER_GUIDE.md)

## Milestones

Expand All @@ -46,6 +97,10 @@ Please refer to [User Guide](./docs/USER_GUIDE.md)

See [CONTRIBUTING](./CONTRIBUTING.md) for details on submitting patches and the contribution workflow.

## License

Apache License 2.0, [LICENSE](https://github.com/apache/apisix-dashboard/blob/master/LICENSE)

## FAQ

1. If you need the dashboard-1.0 which is built with Vue.js, please refer to [master-vue](https://github.com/apache/apisix-dashboard/tree/master-vue).
Expand Down
66 changes: 56 additions & 10 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,65 @@

# [Apache APISIX](https://github.com/apache/apisix) 控制台
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved

## 用户指南
Apache APISIX Dashboard 项目的目标是为了让大家快速上手体验和学习 Apache APISIX,并不能直接用于生产环境。所以它的功能点覆盖永远都是 Apache APISIX 的子集,也可能会滞后于 Apache APISIX 的快速迭代。如果你需要把 Dashboard 项目用于生产系统,需要对用户权限、通讯安全、高可用、高级功能等方面做增强。

请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)
## 安装

我们有多种方式来安装 APISIX dashboard

### Docker

我们可以通过下面的方法来启动一个可运行的版本

- [使用 Docker 一键部署](./docs/deploy-with-docker.zh-CN.md)

### 从源代码构建

从源代码构建,首先先确认你的 `golang` 版本在 1.13 或者 更高的版本。
同样你也需要提前按照好 `node` 和 `yarn`

```
$ git clone -b v2.0 https://github.com/apache/apisix-dashboard.git && cd apisix-dashboard
$ make build
```

然后你可以在 `./output` 目录下找到运行 dashboard 需要的所有文件(配置文件、可执行文件、web静态资源)

## 部署
通过下面的命令启动

当前支持如下方式部署:
```sh
$ cd ./output
$ export ENV=local && exec ./manager-api
```

- [手动部署](./docs/deploy.zh-CN.md)
- [使用 Docker 部署](./docs/deploy-with-docker.zh-CN.md)
`makefile` 提供以下几种命令

## 开发
```
Makefile rules:

开发分为 Apache APISIX 开发、Dashboard 开发
help: Show Makefile rules
build: build dashboard, it contains web and manager-api
api-test: Run the tests of manager-api
api-run: Run the manager-api
api-stop: stop manager-api
golang-lint: Lint Go source code
license-check: Check apisix-dashboard source codes for Apache License
```

- [Apache APISIX](https://github.com/apache/apisix)
- [Dashboard](./docs/develop.zh-CN.md)
更详细的构建步骤参见这里 - [从源代码构建](./docs/deploy.zh-CN.md)

### 开发者

apisix-dashboard 为 [Apache APISIX](https://github.com/apache/apisix) 提供管理界面,需要先 [安装 APISIX](https://github.com/apache/apisix#configure-and-installation).
gxthrj marked this conversation as resolved.
Show resolved Hide resolved

然后请参考这里分别启动 `manager-api` 和 `web`

- [依赖检查](#依赖检查)
- [开发 Dashboard](./docs/develop.zh-CN.md)

## Dashboard 使用指南

请参考 [用户指南](./docs/USER_GUIDE.zh-CN.md)

## 里程碑

Expand All @@ -48,6 +90,10 @@

请参考[贡献指南](./CONTRIBUTING.md)以获取更详细的流程。

## License

Apache License 2.0, [LICENSE](https://github.com/apache/apisix-dashboard/blob/master/LICENSE)

## FAQ

1. 如果你需要 Vue.js 构建的 dashboard-1.0,请使用 [master-vue 分支](https://github.com/apache/apisix-dashboard/tree/master-vue)。
Expand Down
2 changes: 2 additions & 0 deletions docs/deploy-with-docker.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ $ docker build -t apisix-dashboard:{$tag} .
$ docker run -d -p 80:8080 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml --name apisix-dashboard apisix-dashboard:{$tag}
```

现在你可以在浏览器中通过 `http://127.0.0.1` 访问。
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved

## 注意

1. 构建镜像后,如需修改配置文件,可通过使用 `docker -v /local-path-to-conf-file:/conf/conf.yaml` 参数指定 `manager-api` 所需要的配置文件,以便启动容器时动态加载配置文件。
Expand Down
Loading