mirror of
https://gitee.com/yadong.zhang/JustAuth.git
synced 2025-12-06 16:58:24 +08:00
🥚 添加实用工具,方便每次发版批量更新依赖版本
This commit is contained in:
parent
0700d7ee25
commit
e868d43ca3
8
.gitignore
vendored
8
.gitignore
vendored
@ -25,7 +25,11 @@ hs_err_pid*
|
|||||||
# exclude idea files
|
# exclude idea files
|
||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
*.sh
|
bin/codecov.sh
|
||||||
bin/*
|
bin/deploy.sh
|
||||||
|
bin/docsify-cli.sh
|
||||||
|
bin/push.sh
|
||||||
|
bin/push-dev.sh
|
||||||
|
|
||||||
target
|
target
|
||||||
|
/pom.xml.versionsBackup
|
||||||
|
|||||||
35
bin/repVersion.sh
Normal file
35
bin/repVersion.sh
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#-----------------------------------------------------------
|
||||||
|
# 参考自 hutool 工具
|
||||||
|
# 此脚本用于每次升级justauth时替换相应位置的版本号
|
||||||
|
#-----------------------------------------------------------
|
||||||
|
pwd=$(pwd)
|
||||||
|
echo "当前路径:$pwd"
|
||||||
|
|
||||||
|
if [ -n "$1" ];then
|
||||||
|
new_version="$1"
|
||||||
|
old_version=`cat $pwd/bin/version.txt`
|
||||||
|
echo "$old_version 替换为新版本 $new_version"
|
||||||
|
else
|
||||||
|
# 参数错误,退出
|
||||||
|
echo "ERROR: 请指定新版本!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -n "$old_version" ]; then
|
||||||
|
echo "ERROR: 旧版本不存在,请确认bin/version.txt中信息正确"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 替换README.md等文件中的版本
|
||||||
|
sed -i "s/${old_version}/${new_version}/g" $pwd/README.md
|
||||||
|
sed -i "s/${old_version}/${new_version}/g" $pwd/README.en-US.md
|
||||||
|
sed -i "s/${old_version}/${new_version}/g" $pwd/docs/README.md
|
||||||
|
sed -i "s/${old_version}/${new_version}/g" $pwd/docs/_coverpage.md
|
||||||
|
|
||||||
|
# 替换pom.xml中的版本
|
||||||
|
sed -i "s/${old_version}/${new_version}/g" $pwd/pom.xml
|
||||||
|
|
||||||
|
# 保留新版本号
|
||||||
|
echo "$new_version" > $pwd/bin/version.txt
|
||||||
19
bin/updVersion.sh
Normal file
19
bin/updVersion.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#------------------------------------------------
|
||||||
|
# 参考自 hutool 工具
|
||||||
|
# 升级justauth版本,包括:
|
||||||
|
# 1. 升级pom.xml中的版本号
|
||||||
|
# 2. 替换README.md中的版本号
|
||||||
|
#------------------------------------------------
|
||||||
|
|
||||||
|
if [ ! -n "$1" ]; then
|
||||||
|
echo "ERROR: 新版本不存在,请指定参数1"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 替换所有模块pom.xml中的版本
|
||||||
|
mvn versions:set -DnewVersion=$1
|
||||||
|
|
||||||
|
# 替换其它地方的版本
|
||||||
|
source $(pwd)/bin/repVersion.sh "$1"
|
||||||
1
bin/version.txt
Normal file
1
bin/version.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
1.13.2
|
||||||
20
ja.sh
Normal file
20
ja.sh
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 参考自 hutool 工具
|
||||||
|
help(){
|
||||||
|
echo "--------------------------------------------------------------------------"
|
||||||
|
echo ""
|
||||||
|
echo "usage: ./ja.sh [updv]"
|
||||||
|
echo ""
|
||||||
|
echo "-updv [version num] Update all justauth related versions."
|
||||||
|
echo ""
|
||||||
|
echo "--------------------------------------------------------------------------"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
'updv')
|
||||||
|
bin/updVersion.sh $2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
esac
|
||||||
Loading…
x
Reference in New Issue
Block a user