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

fix(portal): fix SC2045-ShellCheck #14

Open
wants to merge 4 commits into
base: v0.2.2-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,8 @@ details see [here](docs/en/contributing/contributing.md)
## Connect

- DingTalk Group:34222602
- we need your ideas for a better AppActive https://www.wjx.cn/vj/P9FB5QR.aspx
- We need your ideas for a better AppActive https://www.wjx.cn/vj/P9FB5QR.aspx

## User registration

If you have used or intend to use AppActive in your business system, please let us know, your support is very important to us: https://github.com/alibaba/Appactive/issues/10
6 changes: 5 additions & 1 deletion appactive-demo/quit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@
# limitations under the License.
#

docker-compose down
if [[ -z $1 ]]; then
docker-compose down
else
docker-compose -f "$1" down
fi
10 changes: 5 additions & 5 deletions appactive-demo/run-nacos-quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

export appactiveNamespaceId="appactiveDemoNamespaceId"
docker-compose -f docker-compose-nacos-quick.yml up -d nacos mysql
sleep 40s
sleep 40

curl -X POST 'http:https://127.0.0.1:8848/nacos/v1/console/namespaces' -d 'customNamespaceId=appactiveDemoNamespaceId&namespaceName=appactiveDemoNamespaceName&namespaceDesc=appactiveDemoNamespaceDesc'

Expand All @@ -25,14 +25,14 @@ sh baseline.sh 2 NACOS appactiveDemoNamespaceId

cd ../appactive-demo
docker-compose -f docker-compose-nacos-quick.yml up -d storage storage-unit
sleep 15s
sleep 15
docker-compose -f docker-compose-nacos-quick.yml up -d product product-unit
sleep 15s
sleep 15
docker-compose -f docker-compose-nacos-quick.yml up -d frontend frontend-unit
sleep 3s
sleep 3
docker-compose -f docker-compose-nacos-quick.yml up -d gateway

sleep 3s
sleep 3
cd ../appactive-portal
sh baseline.sh 3

Expand Down
6 changes: 3 additions & 3 deletions appactive-demo/run-nacos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ then
export appactiveNamespaceId="${temp}"
docker-compose -f docker-compose-nacos.yml build
docker-compose -f docker-compose-nacos.yml up -d storage storage-unit
sleep 15s
sleep 15
docker-compose -f docker-compose-nacos.yml up -d product product-unit
sleep 15s
sleep 15
docker-compose -f docker-compose-nacos.yml up -d frontend frontend-unit
sleep 3s
sleep 3
docker-compose -f docker-compose-nacos.yml up -d gateway
fi

Expand Down
10 changes: 5 additions & 5 deletions appactive-demo/run-quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ sh baseline.sh 2

cd ../appactive-demo
docker-compose -f docker-compose-quick.yml up -d nacos mysql
sleep 20s
sleep 20
docker-compose -f docker-compose-quick.yml up -d storage storage-unit
sleep 15s
sleep 15
docker-compose -f docker-compose-quick.yml up -d product product-unit
sleep 15s
sleep 15
docker-compose -f docker-compose-quick.yml up -d frontend frontend-unit
sleep 3s
sleep 3
docker-compose -f docker-compose-quick.yml up -d gateway

sleep 3s
sleep 3
cd ../appactive-portal
sh baseline.sh 3

Expand Down
8 changes: 4 additions & 4 deletions appactive-demo/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

docker-compose build
docker-compose up -d nacos mysql
sleep 20s
sleep 20
docker-compose up -d storage storage-unit
sleep 15s
sleep 15
docker-compose up -d product product-unit
sleep 15s
sleep 15
docker-compose up -d frontend frontend-unit
sleep 3s
sleep 3
docker-compose up -d gateway

# docker-compose up --no-recreate
Expand Down
19 changes: 10 additions & 9 deletions appactive-portal/baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,21 @@ if [ `expr $type % 2` == 0 ]
then
if [ $channel = "FILE" ]
then
for file in $(ls ../appactive-demo/data/); do
for file in ../appactive-demo/data/; do
[[ -e "$file" ]] || break
if [[ "$file" == *"path-address"* ]]; then
echo "continue"
continue
fi
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file} 基线推送中";
cp -f ./rule/idSource.json "../appactive-demo/data/$file/"
cp -f ./rule/transformerBetween.json "../appactive-demo/data/$file/idTransformer.json"
cp -f ./rule/idUnitMapping.json "../appactive-demo/data/$file/"
cp -f ./rule/dbProperty.json "../appactive-demo/data/$file/mysql-product"
arr=(${file//-/ })
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file##*/} 基线推送中";
cp -f ./rule/idSource.json "$file/"
cp -f ./rule/transformerBetween.json "$file/idTransformer.json"
cp -f ./rule/idUnitMapping.json "$file/"
cp -f ./rule/dbProperty.json "$file/mysql-product"
arr=(${${file##*/}//-/ })
unitFlag=${arr[1]}
echo "{\"unitFlag\":\"${unitFlag}\"}" > "../appactive-demo/data/$file/machine.json"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file} 基线推送完成"
echo "{\"unitFlag\":\"${unitFlag}\"}" > "$file/machine.json"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file##*/} 基线推送完成"
done
elif [ $channel = "NACOS" ]
then
Expand Down
26 changes: 14 additions & 12 deletions appactive-portal/cut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ idUnitMappingNextFile="idUnitMappingNext.json"

if [ $channel = "FILE" ]
then
for file in $(ls ../appactive-demo/data/); do
for file in ../appactive-demo/data/*; do
[[ -e "$file" ]] || break
if [[ "$file" == *"path-address"* ]]; then
echo "continue"
continue
fi
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file} 禁写规则推送中)"
cp -f ./rule/$forbiddenFile "../appactive-demo/data/$file/forbiddenRule.json"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file} 禁写规则推送完成"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file##*/} 禁写规则推送中)"
cp -f ./rule/$forbiddenFile "$file/forbiddenRule.json"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file##*/} 禁写规则推送完成"
done
elif [ $channel = "NACOS" ]
then
Expand All @@ -69,22 +70,23 @@ echo "$(date "+%Y-%m-%d %H:%M:%S") gateway 新规则推送结果: " && curl --he
127.0.0.1:8090/set

echo "等待数据追平......"
sleep "${waitTime}s"
sleep "${waitTime}"
echo "数据已经追平,下发新规则......"

if [ $channel = "FILE" ]
then
for file in $(ls ../appactive-demo/data/); do
for file in ../appactive-demo/data/*; do
[[ -e "$file" ]] || break
if [[ "$file" == *"path-address"* ]]; then
echo "continue"
continue
fi
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file} 新规则推送中"
cp -f ./rule/$idUnitMappingNextFile "../appactive-demo/data/$file/idUnitMapping.json"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file} 新规则推送完成"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file} 清除禁写规则推送中)"
cp -f ./rule/$forbiddenFileEmpty "../appactive-demo/data/$file/forbiddenRule.json"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file} 清除禁写规则推送完成"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file##*/} 新规则推送中"
cp -f ./rule/$idUnitMappingNextFile "$file/idUnitMapping.json"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file##*/} 新规则推送完成"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file##*/} 清除禁写规则推送中)"
cp -f ./rule/$forbiddenFileEmpty "$file/forbiddenRule.json"
echo "$(date "+%Y-%m-%d %H:%M:%S") 应用 ${file##*/} 清除禁写规则推送完成"
done
elif [ $channel = "NACOS" ]
then
Expand Down
3 changes: 3 additions & 0 deletions docs/cn/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@ AppActive 整体架构覆盖数据面和管控面,全流程管理应用流量
- 钉钉群(推荐):34222602
- 一起建设更好的 AppActive https://www.wjx.cn/vj/P9FB5QR.aspx

## 用户登记

如果你已经或者打算在业务系统中使用AppActive,请让我们知道,你的使用对我们很重要:https://github.com/alibaba/Appactive/issues/10


2 changes: 1 addition & 1 deletion docs/cn/details/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ AppActive 在业务模型上核心分为四部分,如上图所示:
- 接入层: 入口流量请求,一般业务应用入口会有一层网关。AppActive 在这一层提供标准的流量控制插件,平滑支持应用的入口流量控制。
- 服务层: 内部应用的同步调用方式,一般为 restful 直连调用或标准微服务框架。AppActive 在这一层提供标准的微服务控制插件,适配不同微服务调用方式。
- 消息层: 内部应用的异步调用方式,一般为通用的 MQ,例如 RocketMQ、Kafka等。AppActive 在这一层提供标准的MQ控制插件,适配不同的消息形态。
- 数据层: 应用访问数据库,数据库一般有 mysql、nosql、Oracle。AppActive 在这一层提供标准的数据库控制插件,保障数据质量,适配不同的数据库形态。
- 数据层: 应用访问数据库,数据库一般有 MySQL、NoSQL、Oracle。AppActive 在这一层提供标准的数据库控制插件,保障数据质量,适配不同的数据库形态。


2 changes: 1 addition & 1 deletion docs/cn/details/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ nav_order: 7
2. 绑定本地 host: `127.0.0.1 demo.appactive.io`,浏览器访问 `http:https://demo.appactive.io/buyProduct?r_id=2000` 查看效果
3. 在`appactive-portal` 模块中运行 `sh cut.sh` 进行切流 。需要注意的是,本 demo 的禁写规则是写死的,用户若要更换切流范围则需自行计算禁写规则和下次路由规则,然后执行切流。

> 如果你打算停止体验,可进行:`cd appactive-demo` -> `docker-compose down`
> 如果你打算停止体验,可进行:`cd appactive-demo` -> `sh quit.sh`

## 源码构建

Expand Down
2 changes: 1 addition & 1 deletion docs/cn/details/demo_nacos.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ nav_order: 3
2. 绑定本地 host: `127.0.0.1 demo.appactive.io`,浏览器访问 `http:https://demo.appactive.io/buyProduct?r_id=2000` 查看效果
3. 在`appactive-portal` 模块中运行 `sh cut.sh NACOS appactiveDemoNamespaceId` 进行切流 。需要注意的是,本 demo 的禁写规则是写死的,用户若要更换切流范围则需自行计算禁写规则和下次路由规则,然后执行切流。

> 如果你打算停止体验,可进行:`cd appactive-demo` -> `sh quit.sh`
> 如果你打算停止体验,可进行:`cd appactive-demo` -> `sh quit.sh ./docker-compose-nacos-quick.yml`

若想直接体验,请见[官方demo站点](http:https://demo.appactive.io/)

Expand Down
4 changes: 2 additions & 2 deletions docs/en/details/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ Visit [nginx-plugin](/appactive-gateway/nginx-plugin/Readme.md)

### Dubbo

The building process of Dubbo demo is too complicated,we suggest using demo in "quick start":
1. first of all, modify rules in frontend-center, so that frontend-center would route request to the wrong unit
The building process of Dubbo demo is too complicated,we suggest using demo in "quick start":
1. first of all, modify rules in frontend-center, so that frontend-center would route request to the wrong unit

```
cd data/frontend-center
Expand Down
2 changes: 1 addition & 1 deletion docs/en/details/demo_nacos.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ If you want to experience demo directly, please visit [demo site](http:https://demo.
sh baseline.sh 2 NACOS appactiveDemoNamespaceId
```

3. Run maysql in `appactive-demo`
3. Run mysql in `appactive-demo`

```
cd dependency/mysql && sh run.sh
Expand Down
2 changes: 1 addition & 1 deletion docs/en/details/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ The entry application is responsible for extracting the routing beacon from the
The core is to add annotations
`parameters = {"rsActive","unit","routeIndex","0"}`
If rsActive is unit, it indicates that this is a unit service, and a routeIndex of 0 indicates that the route ID is the 0th parameter.
The candidate values ​​of rsActive are:
The candidate values of rsActive are:

- normal: normal service, which requires no multi-active modification, and will route as it was
- unit: unit service, which will only route within right unit according to multi-active rules
Expand Down