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

修正前端依赖配置并升级mysql驱动程序 #801

Open
wants to merge 5 commits into
base: develop
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
2 changes: 1 addition & 1 deletion docs/zh-cn/3.x/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

- [作业的灰度发布](zh-cn/3.x/grayscale_publishing.md)
- [性能测试报告](zh-cn/3.x/saturn_performance_test_2017.md)

- [编译说明](zh-cn/3.x/compile.md)
- [Release Note](https://github.com/vipshop/Saturn/releases)

- [Release Roadmap](zh-cn/3.x/saturn3-roadmap.md)
Expand Down
53 changes: 53 additions & 0 deletions docs/zh-cn/3.x/compile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 编译说明
如果你需要对Saturn进行改动并重新编译和构建,请参考以下说明,可以帮助简化相关问题处理,更顺利的完成构建。

温馨提示:执行所有步骤前,请确认自己的网络环境,最好是能够顺利访问所有依赖资源的网址。
以下步骤以MAC OS为例,其他操作系统请参考此过程进行灵活处理。

### 1、依赖安装
Saturn编译过程依赖jdk、nodejs、python(python2)
#### 1.1、安装JDK
请安装JDK1.7或者1.8,步骤略过
#### 1.2、安装nodejs
请安装nodejs v8.17.0
```Shell
# layouts.download.codeBox.installsNvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# layouts.download.codeBox.downloadAndInstallNodejsRestartTerminal
nvm install 8
# layouts.download.codeBox.verifiesRightNodejsVersion
node -v # layouts.download.codeBox.shouldPrint
# layouts.download.codeBox.verifiesRightNpmVersion
npm -v # layouts.download.codeBox.shouldPrint
```
#### 1.3、安装python
Saturn当前版本依赖古老的python2,请安装2.7.18
下载地址:https://www.python.org/downloads/release/python-2718/

#### 1.4、检查各个依赖版本
```Shell
#java -version
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)
#node -v
v8.17.0
#python --version
Python 2.7.18
```
### 2、构建顺序
Saturn的项目构建依赖一个插件,需要先本地构建和安装下这个插件
```Shell
cd saturn-plugin
mvn install
```
后面就可以整个项目构建了

```Shell
mvn clean
mvn package
```
如果报错的话,大概率是以下几个问题,请检查确认。
1、node版本是否安装正确
2、python版本是否安装正确
3、网络环境是否有问题
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@
<mybatis.version>3.2.7</mybatis.version>
<mybatis.spring.version>1.2.5</mybatis.spring.version>
<mybatis.generator.version>1.3.2</mybatis.generator.version>

<mysql.connector.java.version>5.1.34</mysql.connector.java.version>

<!--升级mysql驱动版本-->
<!--<mysql.connector.java.version>5.1.34</mysql.connector.java.version>-->
<mysql.connector.java.version>8.0.23</mysql.connector.java.version>

<spring.data.commons.version>1.13.16.RELEASE</spring.data.commons.version>
<druid.version>1.1.5</druid.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
id, job_name, job_class, sharding_total_count, load_level, job_degree, enabled_report, local_mode, use_serial,
use_disprefer_list, time_zone, cron, prefer_list, pause_period_date, pause_period_time,
sharding_item_parameters, job_parameter, process_count_interval_seconds,
failover, dependencies, groups, description, timeout_4_alarm_seconds, timeout_seconds, show_normal_log,
failover, dependencies, `groups`, description, timeout_4_alarm_seconds, timeout_seconds, show_normal_log,
channel_name, job_type, queue_name, create_by, create_time, last_update_by, last_update_time,
namespace, zk_list,is_enabled,job_mode,custom_context,rerun, up_stream, down_stream, disable_timeout_seconds
</sql>
Expand All @@ -70,16 +70,16 @@
<choose>
<when test="condition.groups == null"></when>
<when test="condition.groups == ''">
and (groups = #{condition.groups} or groups is NULL)
and (`groups` = #{condition.groups} or `groups` is NULL)
</when>
<otherwise>
and (
<foreach collection="condition.groups.split(',')" item="item" separator="or">
<if test="item != '未分组'">
FIND_IN_SET(#{item}, groups)
FIND_IN_SET(#{item}, `groups`)
</if>
<if test="item == '未分组'">
(groups = '' or groups is NULL)
(`groups` = '' or `groups` is NULL)
</if>
</foreach>
)
Expand Down Expand Up @@ -123,16 +123,16 @@
<choose>
<when test="condition.groups == null"></when>
<when test="condition.groups == ''">
and (groups = #{condition.groups} or groups is NULL)
and (`groups` = #{condition.groups} or `groups` is NULL)
</when>
<otherwise>
and (
<foreach collection="condition.groups.split(',')" item="item" separator="or">
<if test="item != '未分组'">
FIND_IN_SET(#{item}, groups)
FIND_IN_SET(#{item}, `groups`)
</if>
<if test="item == '未分组'">
(groups = '' or groups is NULL)
(`groups` = '' or `groups` is NULL)
</if>
</foreach>
)
Expand Down Expand Up @@ -201,7 +201,7 @@
time_zone, cron, prefer_list, pause_period_date,
pause_period_time, sharding_item_parameters,
job_parameter, process_count_interval_seconds,
failover, dependencies, groups, description,
failover, dependencies, `groups`, description,
timeout_4_alarm_seconds, timeout_seconds, show_normal_log, channel_name,
job_type, queue_name, create_by,
create_time, last_update_by, last_update_time,
Expand Down Expand Up @@ -249,7 +249,7 @@
process_count_interval_seconds = #{processCountIntervalSeconds,jdbcType=INTEGER},
failover = #{failover,jdbcType=BIT},
dependencies = #{dependencies,jdbcType=VARCHAR},
groups = #{groups,jdbcType=VARCHAR},
`groups` = #{groups,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
timeout_4_alarm_seconds = #{timeout4AlarmSeconds,jdbcType=INTEGER},
timeout_seconds = #{timeoutSeconds,jdbcType=INTEGER},
Expand Down Expand Up @@ -290,14 +290,14 @@
<update id="addToGroups">
UPDATE job_config
SET last_update_by = #{lastUpdateBy,jdbcType=VARCHAR},
groups =
`groups` =
(
CASE
WHEN groups REGEXP '^${groupName},' THEN groups
WHEN groups REGEXP ',${groupName}$' THEN groups
WHEN groups REGEXP ',${groupName},' THEN groups
WHEN groups IS NULL OR groups = '' THEN CONCAT(groups,'${groupName}')
ELSE CONCAT(groups,',${groupName}')
WHEN `groups` REGEXP '^${groupName},' THEN `groups`
WHEN `groups` REGEXP ',${groupName}$' THEN `groups`
WHEN `groups` REGEXP ',${groupName},' THEN `groups`
WHEN `groups` IS NULL OR `groups` = '' THEN CONCAT(`groups`,'${groupName}')
ELSE CONCAT(`groups`,',${groupName}')
END
)
WHERE namespace = #{namespace,jdbcType=VARCHAR}
Expand All @@ -311,14 +311,14 @@
<update id="batchSetGroups">
UPDATE job_config
SET last_update_by = #{lastUpdateBy,jdbcType=VARCHAR},
groups =
`groups` =
(
CASE
WHEN groups REGEXP '^${groupName},' THEN RIGHT(groups, LENGTH(groups) - LENGTH('${groupName},'))
WHEN groups REGEXP ',${groupName}$' THEN LEFT(groups, LENGTH(groups) - LENGTH(',${groupName}'))
WHEN groups REGEXP ',${groupName},' THEN REPLACE(groups, ',${groupName},', ',')
WHEN groups = '${groupName}' THEN ''
ELSE groups
WHEN `groups` REGEXP '^${groupName},' THEN RIGHT(`groups`, LENGTH(`groups`) - LENGTH('${groupName},'))
WHEN `groups` REGEXP ',${groupName}$' THEN LEFT(`groups`, LENGTH(`groups`) - LENGTH(',${groupName}'))
WHEN `groups` REGEXP ',${groupName},' THEN REPLACE(`groups`, ',${groupName},', ',')
WHEN `groups` = '${groupName}' THEN ''
ELSE `groups`
END
)
WHERE namespace = #{namespace,jdbcType=VARCHAR}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<sql id="Base_Column_List" >
id, job_name, job_class, sharding_total_count, load_level, job_degree, enabled_report, local_mode, use_serial, use_disprefer_list, time_zone, cron, prefer_list, pause_period_date, pause_period_time,
sharding_item_parameters, job_parameter, process_count_interval_seconds,
failover, dependencies, groups, description, timeout_4_alarm_seconds, timeout_seconds, show_normal_log,
failover, dependencies, `groups`, description, timeout_4_alarm_seconds, timeout_seconds, show_normal_log,
channel_name, job_type, queue_name, create_by, create_time, last_update_by, last_update_time,
namespace, zk_list,zk_list,job_mode,custom_context,disable_timeout_seconds
</sql>
Expand All @@ -62,7 +62,7 @@
sharding_total_count, load_level, job_degree, enabled_report, local_mode, use_serial, use_disprefer_list, time_zone, cron, prefer_list, pause_period_date,
pause_period_time, sharding_item_parameters,
job_parameter, process_count_interval_seconds,
failover, dependencies, groups, description,
failover, dependencies, `groups`, description,
timeout_4_alarm_seconds, timeout_seconds, show_normal_log, channel_name,
job_type, queue_name, create_by,
create_time, last_update_by, last_update_time,
Expand Down Expand Up @@ -146,7 +146,7 @@
dependencies,
</if>
<if test="groups != null">
groups,
`groups`,
</if>
<if test="description != null" >
description,
Expand Down Expand Up @@ -369,7 +369,7 @@
dependencies = #{dependencies,jdbcType=VARCHAR},
</if>
<if test="groups != null">
groups = #{groups,jdbcType=VARCHAR},
`groups` = #{groups,jdbcType=VARCHAR},
</if>
<if test="description != null" >
description = #{description,jdbcType=VARCHAR},
Expand Down Expand Up @@ -443,7 +443,7 @@
process_count_interval_seconds = #{processCountIntervalSeconds,jdbcType=INTEGER},
failover = #{failover,jdbcType=BIT},
dependencies = #{dependencies,jdbcType=VARCHAR},
groups = #{groups,jdbcType=VARCHAR},
`groups` = #{groups,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
timeout_4_alarm_seconds = #{timeout4AlarmSeconds,jdbcType=INTEGER},
timeout_seconds = #{timeoutSeconds,jdbcType=INTEGER},
Expand Down
6 changes: 4 additions & 2 deletions saturn-console-web/npm-config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

# Set npm registered address
npm config set registry https://registry.npm.taobao.org
#npm config set registry https://registry.npm.taobao.org
npm config set registry https://registry.npmmirror.com

# Set sass_binary_site address
npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
#npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
Loading