-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70f6c81
commit e4c31de
Showing
6 changed files
with
107 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,7 @@ logs/ | |
**/mvnw.cmd | ||
**/.mvn | ||
|
||
**/target | ||
**/target | ||
|
||
### bak ### | ||
*.versionsBackup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@echo off | ||
|
||
REM ## 开始 | ||
echo [INFO] ----------------------------- start -------------------------------------- | ||
|
||
REM ## 获取入参,版本号 | ||
set new_versiont=%1% | ||
REM ## 输出看一眼 | ||
echo new_versiont: %new_versiont% | ||
|
||
REM ## 获取入参,是否需要备份(true | false) | ||
set is_bak=%2% | ||
REM ## 输出看一眼 | ||
echo is_bak: %is_bak% | ||
|
||
REM ## 非空判断 | ||
if defined new_versiont ( | ||
REM ## 1. 更新 commons 工程版本号 | ||
cd osc-commons/ | ||
REM ## 获取当前工程的版本号 | ||
REM for /f "delims=" %%i in ('..\old-version.bat') do set old_version=%%i | ||
REM ## 输出看一眼 | ||
REM echo old_version: %old_version% | ||
REM ## 升级 | ||
mvn versions:set -DoldVersion=* -DnewVersion=%new_versiont% -DgenerateBackupPoms=%is_bak% && mvn clean install | ||
|
||
REM ## 2. 更新 service 工程中的 commons 工程版本号 | ||
cd ../osc-service/ | ||
REM ## 获取当前工程的版本号 | ||
REM for /f "delims=" %%i in ('..\old-version.bat') do set old_version=%%i | ||
REM ## 输出看一眼 | ||
REM echo old_version: %old_version% | ||
REM ## 更新 | ||
mvn versions:update-properties -DincludeProperties={osc.commons.version} -Dproperties=[%new_versiont%] -DgenerateBackupPoms=%is_bak% | ||
|
||
REM ## 3. 更新 service 工程版本号 | ||
mvn versions:set -DoldVersion=* -DnewVersion=%new_versiont% -DgenerateBackupPoms=%is_bak% | ||
|
||
REM ## 结束 | ||
echo [INFO] ----------------------------- end -------------------------------------- | ||
) else ( | ||
REM ## 结束 | ||
echo [INFO] -------------------------- 缺少参数 ------------------------------------- | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
## $() - 方法,${} - 变量 | ||
|
||
## 开始 | ||
echo [INFO] ----------------------------- start -------------------------------------- | ||
|
||
## 获取入参,版本号 | ||
new_versiont=$1 | ||
## 输出看一眼 | ||
echo new_versiont: ${new_versiont} | ||
|
||
## 获取入参,是否需要备份(true | false) | ||
is_bak=$2 | ||
## 输出看一眼 | ||
echo is_bak: ${is_bak} | ||
|
||
## 非空判断 | ||
if [ $new_versiont ]; | ||
then | ||
|
||
## 1. 更新 commons 工程版本号 | ||
cd osc-commons/ | ||
## 获取当前工程的版本号 | ||
## old_version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout) | ||
## 输出看一眼 | ||
## echo old_version: ${old_version} | ||
## 升级 | ||
mvn versions:set -DoldVersion=* -DnewVersion=${new_versiont} -DgenerateBackupPoms=${is_bak} && mvn clean install | ||
|
||
## 2. 更新 service 工程中的 commons 工程版本号 | ||
cd ../osc-service/ | ||
## 获取当前工程的版本号 | ||
## old_version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout) | ||
## 输出看一眼 | ||
## echo old_version: ${old_version} | ||
## 更新 | ||
mvn versions:update-properties -DincludeProperties={osc.commons.version} -Dproperties=[${new_versiont}] -DgenerateBackupPoms=${is_bak} | ||
|
||
## 3. 更新 service 工程版本号 | ||
mvn versions:set -DoldVersion=* -DnewVersion=${new_versiont} -DgenerateBackupPoms=${is_bak} | ||
|
||
## 结束 | ||
echo [INFO] ----------------------------- end -------------------------------------- | ||
|
||
else | ||
|
||
## 结束 | ||
echo [INFO] -------------------------- 缺少参数 ------------------------------------- | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
|
||
mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters