From c9e77a61e2d686ed3af8a188f5900351429ab38d Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Sun, 10 Jan 2021 19:47:16 +0800 Subject: [PATCH] + add script bump-cola-version.sh --- scripts/bump-cola-version.sh | 38 ++++++++++++++++++++++++++++++++++++ scripts/maven-deploy.md | 5 ++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 scripts/bump-cola-version.sh diff --git a/scripts/bump-cola-version.sh b/scripts/bump-cola-version.sh new file mode 100755 index 000000000..7f5ec5d5d --- /dev/null +++ b/scripts/bump-cola-version.sh @@ -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~()(.*)()~\1'"$bump_version"'\3~' \ + cola-archetype-service/src/main/resources/archetype-resources/pom.xml \ + cola-archetype-web/src/main/resources/archetype-resources/pom.xml +) diff --git a/scripts/maven-deploy.md b/scripts/maven-deploy.md index 297b53f35..fd5500c16 100644 --- a/scripts/maven-deploy.md +++ b/scripts/maven-deploy.md @@ -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),执行发布 @@ -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