Skip to content

Commit 8ff8e70

Browse files
committed
HBASE-24296 install yetus as a part of building the rm docker image.
* non-zero exit for usage * in non-docker mode prompt for yetus install location * make sure we exit if YETUS_HOME does not actually point at a yetus install. closes #1726 Signed-off-by: Matt Foley <mattf@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org> Signed-off-by: stack <stack@apache.org>
1 parent 2b894dc commit 8ff8e70

File tree

5 files changed

+37
-7
lines changed

5 files changed

+37
-7
lines changed

dev-support/create-release/do-release-docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Options:
7575
If none specified, runs tag, then publish-dist, and then publish-release.
7676
'publish-snapshot' is also an allowed, less used, option.
7777
EOF
78+
exit 1
7879
}
7980

8081
WORKDIR=

dev-support/create-release/do-release.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ function should_build {
8383
}
8484

8585
if should_build "tag" && [ "$SKIP_TAG" = 0 ]; then
86+
if [ -z "${YETUS_HOME}" ] && [ "${RUNNING_IN_DOCKER}" != "1" ]; then
87+
declare local_yetus="/opt/apache-yetus/0.11.1/"
88+
if [ "$(get_host_os)" = "DARWIN" ]; then
89+
local_yetus="/usr/local/Cellar/yetus/0.11.1/"
90+
fi
91+
YETUS_HOME="$(read_config "YETUS_HOME not defined. Absolute path to local install of Apache Yetus" "${local_yetus}")"
92+
export YETUS_HOME
93+
fi
8694
run_silent "Creating release tag $RELEASE_TAG..." "tag.log" \
8795
"$SELF/release-build.sh" tag
8896
if is_dry_run; then

dev-support/create-release/hbase-rm/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y update \
4343
&& update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java \
4444
&& pip install \
4545
python-dateutil==2.8.1
46+
# Install Apache Yetus
47+
ENV YETUS_VERSION 0.11.1
48+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
49+
RUN wget -qO- "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=/yetus/${YETUS_VERSION}/apache-yetus-${YETUS_VERSION}-bin.tar.gz" | \
50+
tar xvz -C /opt
51+
ENV YETUS_HOME /opt/apache-yetus-${YETUS_VERSION}
4652

4753
WORKDIR /opt/hbase-rm/output
4854

dev-support/create-release/release-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Used for 'tag' and 'publish' stages:
5555
to actually publish you have to set '-f' (force) flag in do-release.sh or do-release-docker.sh.
5656
5757
Used only for 'tag':
58+
YETUS_HOME - installation location for Apache Yetus
5859
GIT_NAME - Name to use with git
5960
GIT_EMAIL - E-mail address to use with git
6061
GIT_BRANCH - Git branch on which to make release. Tag is always placed at HEAD of this branch.
@@ -105,6 +106,7 @@ perl --version | grep 'This is'
105106
rm -rf "${PROJECT}"
106107

107108
if [[ "$1" == "tag" ]]; then
109+
init_yetus
108110
# for 'tag' stage
109111
set -o pipefail
110112
set -x # detailed logging during action

dev-support/create-release/release-util.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#
1919
DRY_RUN=${DRY_RUN:-1} #default to dry run
2020
GPG="gpg --pinentry-mode loopback --no-tty --batch"
21-
YETUS_VERSION=${YETUS_VERSION:-0.11.1}
2221
# Maven Profiles for publishing snapshots and release to Maven Central and Dist
2322
PUBLISH_PROFILES=("-P" "apache-release,release")
2423

@@ -349,6 +348,16 @@ function init_mvn {
349348
configure_maven
350349
}
351350

351+
function init_yetus {
352+
declare YETUS_VERSION
353+
if [ -z "${YETUS_HOME}" ]; then
354+
error "Missing Apache Yetus."
355+
fi
356+
# Work around yetus bug by asking test-patch for the version instead of rdm.
357+
YETUS_VERSION=$("${YETUS_HOME}/bin/test-patch" --version)
358+
echo "Apache Yetus version ${YETUS_VERSION}"
359+
}
360+
352361
function configure_maven {
353362
# Add timestamps to mvn logs.
354363
MAVEN_OPTS="-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss ${MAVEN_OPTS}"
@@ -423,17 +432,15 @@ function get_jira_name {
423432

424433
# Update the CHANGES.md
425434
# DOES NOT DO COMMITS! Caller should do that.
435+
# requires yetus to have a defined home already.
426436
# yetus requires python2 to be on the path.
427437
function update_releasenotes {
428438
local project_dir="$1"
429439
local jira_fix_version="$2"
430-
local yetus="apache-yetus-${YETUS_VERSION}"
431440
local jira_project
432441
jira_project="$(get_jira_name "$(basename "$project_dir")")"
433-
wget -qO- "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=/yetus/${YETUS_VERSION}/${yetus}-bin.tar.gz" | \
434-
tar xvz -C . || exit
435-
cd "./${yetus}" || exit
436-
./bin/releasedocmaker -p "${jira_project}" --fileversions -v "${jira_fix_version}" -l --sortorder=newer --skip-credits
442+
"${YETUS_HOME}/bin/releasedocmaker" -p "${jira_project}" --fileversions -v "${jira_fix_version}" \
443+
-l --sortorder=newer --skip-credits
437444
pwd
438445
# First clear out the changes written by previous RCs.
439446
if [ -f "${project_dir}/CHANGES.md" ]; then
@@ -466,7 +473,6 @@ function update_releasenotes {
466473
else
467474
mv "RELEASENOTES.${jira_fix_version}.md" "${project_dir}/RELEASENOTES.md"
468475
fi
469-
cd .. || exit
470476
}
471477

472478
# Make src release.
@@ -608,3 +614,10 @@ function maven_deploy { #inputs: <snapshot|release> <log_file_path>
608614
echo "BUILD SUCCESS."
609615
return 0
610616
}
617+
618+
# guess the host os
619+
# * DARWIN
620+
# * LINUX
621+
function get_host_os() {
622+
uname -s | tr '[:lower:]' '[:upper:]'
623+
}

0 commit comments

Comments
 (0)