Skip to content

Commit

Permalink
Allowing Release from Specific Branches (#3597)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu authored Nov 16, 2023
1 parent 23adaa2 commit 2606066
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions build-bin/maven/maven_release
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ 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
# Checkout the branch that triggered this build
git fetch --tags origin
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
2 changes: 1 addition & 1 deletion docker/test-images/zipkin-mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2606066

Please sign in to comment.