Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing Release from Specific Branches #3597

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
wu-sheng marked this conversation as resolved.
Show resolved Hide resolved

# 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
Loading