Skip to content

Commit

Permalink
+ add script bump-cola-version.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Jan 10, 2021
1 parent 7cd965f commit fa5ef64
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
38 changes: 38 additions & 0 deletions scripts/bump-cola-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
set -eEuo pipefail
# adjust current dir to script dir
cd "$(dirname "$(readlink -f "$0")")"

source common.sh

# shellcheck disable=SC2154
[ $# -ne 1 ] && die "need 1 argument for version!$nl${nl}usage:$nl $0 4.x.y"

readonly bump_version="$1"

source common_build.sh

(
headInfo "bump cola version of cola-components to bump_version"
cd ../cola-components/

MVN_WITH_BASIC_OPTIONS \
org.codehaus.mojo:versions-maven-plugin:2.8.1:set \
-DgenerateBackupPoms=false \
-DnewVersion="$bump_version"
)

(
headInfo "bump cola version of cola-archetypes to bump_version"
cd ../cola-archetypes/

MVN_WITH_BASIC_OPTIONS \
org.codehaus.mojo:versions-maven-plugin:2.8.1:set \
-DgenerateBackupPoms=false \
-DnewVersion="$bump_version"

logAndRun -s \
sed -ri 's~(<cola.components.version>)(.*)(</cola.components.version>)~\1'"$bump_version"'\3~' \
cola-archetype-service/src/main/resources/archetype-resources/pom.xml \
cola-archetype-web/src/main/resources/archetype-resources/pom.xml
)
5 changes: 4 additions & 1 deletion scripts/maven-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ TODO:这个约束应该要去掉。使用`JDK 8`能发布挺好 :")

## 1. 发布 COLA Components

先确认版本号,去掉`SNAPSHOT`,如`4.x.y`
先确认版本号,去掉`SNAPSHOT`,如`4.x.y`
更新版本操作可以通过脚本[`bump-cola-vesion.sh`](bump-cola-version.sh)来统一完成。

[COLA Components的根目录](../cola-components),执行发布

Expand All @@ -56,6 +57,8 @@ TODO:这个约束应该要去掉。使用`JDK 8`能发布挺好 :")
- [`cola-archetypes/cola-archetype-service/src/main/resources/archetype-resources/pom.xml`](../cola-archetypes/cola-archetype-service/src/main/resources/archetype-resources/pom.xml)
- [`cola-archetypes/cola-archetype-web/src/main/resources/archetype-resources/pom.xml`](../cola-archetypes/cola-archetype-web/src/main/resources/archetype-resources/pom.xml)

更新版本操作可以通过脚本[`bump-cola-vesion.sh`](bump-cola-version.sh)来统一完成。

[COLA Archetype的根目录](../cola-archetypes),执行发布

```bash
Expand Down

0 comments on commit fa5ef64

Please sign in to comment.