From c8c10a28029401983504fc7f2a0c24ae6766e6d5 Mon Sep 17 00:00:00 2001 From: hanliu <741550557@qq.com> Date: Thu, 16 Nov 2023 15:35:51 +0800 Subject: [PATCH 1/3] Allowing Release from Specific Branches --- build-bin/maven/maven_release | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/build-bin/maven/maven_release b/build-bin/maven/maven_release index 0ef28e48117..e47bd43ff68 100755 --- a/build-bin/maven/maven_release +++ b/build-bin/maven/maven_release @@ -25,19 +25,10 @@ export MAVEN_OPTS="$($(dirname "$0")/maven_opts)" trigger_tag=${1?trigger_tag is required. Ex release-1.2.3} release_version=$(build-bin/git/version_from_trigger_tag release- ${trigger_tag}) -release_branch=${2:-master} -# Checkout master, as we release from master, not a tag ref -git fetch --no-tags --prune --depth=1 origin +refs/heads/${release_branch}:refs/remotes/origin/${release_branch} -git checkout ${release_branch} - -# Ensure no one pushed commits since this release tag as it would fail later commands -commit_local_release_branch=$(git show --pretty='format:%H' ${release_branch}) -commit_remote_release_branch=$(git show --pretty='format:%H' origin/${release_branch}) -if [ "$commit_local_release_branch" != "$commit_remote_release_branch" ]; then - >&2 echo "${release_branch} on remote 'origin' has commits since the version to release, aborting" - exit 1 -fi +# Checkout the tag to release +git fetch --tags origin +git checkout ${trigger_tag} # Prepare and push release commits and the version tag (N.N.N), which triggers deployment. ./mvnw --batch-mode -nsu -DreleaseVersion=${release_version} -Denforcer.fail=false -Darguments="-DskipTests -Denforcer.fail=false" release:prepare From d743d7f817d5b4f56534300d4aaf8893634c9395 Mon Sep 17 00:00:00 2001 From: hanliu <741550557@qq.com> Date: Thu, 16 Nov 2023 15:57:26 +0800 Subject: [PATCH 2/3] update mysql version to fix CI --- docker/test-images/zipkin-mysql/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test-images/zipkin-mysql/Dockerfile b/docker/test-images/zipkin-mysql/Dockerfile index 9bd4a8ebd29..0722fccac90 100644 --- a/docker/test-images/zipkin-mysql/Dockerfile +++ b/docker/test-images/zipkin-mysql/Dockerfile @@ -37,7 +37,7 @@ HEALTHCHECK --interval=1s --start-period=30s --timeout=5s CMD ["docker-healthche ENTRYPOINT ["start-mysql"] # Use latest from https://pkgs.alpinelinux.org/packages?name=mysql -ARG mysql_version=10.11.4 +ARG mysql_version=10.11.5 LABEL mysql-version=$mysql_version ENV MYSQL_VERSION=$mysql_version From 6151c894cb87c3922e2b3904ffa758a4dd63a687 Mon Sep 17 00:00:00 2001 From: hanliu <741550557@qq.com> Date: Thu, 16 Nov 2023 16:56:30 +0800 Subject: [PATCH 3/3] update the select branch name policy --- build-bin/maven/maven_release | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build-bin/maven/maven_release b/build-bin/maven/maven_release index e47bd43ff68..3df408180c6 100755 --- a/build-bin/maven/maven_release +++ b/build-bin/maven/maven_release @@ -26,9 +26,17 @@ export MAVEN_OPTS="$($(dirname "$0")/maven_opts)" trigger_tag=${1?trigger_tag is required. Ex release-1.2.3} release_version=$(build-bin/git/version_from_trigger_tag release- ${trigger_tag}) -# Checkout the tag to release +# Checkout the branch that triggered this build git fetch --tags origin -git checkout ${trigger_tag} +commit_sha=$(git rev-parse "$trigger_tag") +branches=$(git branch --contains "$commit_sha") +branch_name=$(echo "$branches" | head -n 1 | awk '{print $2}') +if [ -z "$branch_name" ]; then + default_branch="master" + echo "Unable to determine a valid branch. Auto-selecting the default branch: $default_branch" + branch_name=$default_branch +fi +git checkout "$branch_name" # Prepare and push release commits and the version tag (N.N.N), which triggers deployment. ./mvnw --batch-mode -nsu -DreleaseVersion=${release_version} -Denforcer.fail=false -Darguments="-DskipTests -Denforcer.fail=false" release:prepare