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>
This commit is contained in:
parent
2b894dc100
commit
8ff8e70edf
|
@ -75,6 +75,7 @@ Options:
|
|||
If none specified, runs tag, then publish-dist, and then publish-release.
|
||||
'publish-snapshot' is also an allowed, less used, option.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
WORKDIR=
|
||||
|
|
|
@ -83,6 +83,14 @@ function should_build {
|
|||
}
|
||||
|
||||
if should_build "tag" && [ "$SKIP_TAG" = 0 ]; then
|
||||
if [ -z "${YETUS_HOME}" ] && [ "${RUNNING_IN_DOCKER}" != "1" ]; then
|
||||
declare local_yetus="/opt/apache-yetus/0.11.1/"
|
||||
if [ "$(get_host_os)" = "DARWIN" ]; then
|
||||
local_yetus="/usr/local/Cellar/yetus/0.11.1/"
|
||||
fi
|
||||
YETUS_HOME="$(read_config "YETUS_HOME not defined. Absolute path to local install of Apache Yetus" "${local_yetus}")"
|
||||
export YETUS_HOME
|
||||
fi
|
||||
run_silent "Creating release tag $RELEASE_TAG..." "tag.log" \
|
||||
"$SELF/release-build.sh" tag
|
||||
if is_dry_run; then
|
||||
|
|
|
@ -43,6 +43,12 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y update \
|
|||
&& update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java \
|
||||
&& pip install \
|
||||
python-dateutil==2.8.1
|
||||
# Install Apache Yetus
|
||||
ENV YETUS_VERSION 0.11.1
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN wget -qO- "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=/yetus/${YETUS_VERSION}/apache-yetus-${YETUS_VERSION}-bin.tar.gz" | \
|
||||
tar xvz -C /opt
|
||||
ENV YETUS_HOME /opt/apache-yetus-${YETUS_VERSION}
|
||||
|
||||
WORKDIR /opt/hbase-rm/output
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ Used for 'tag' and 'publish' stages:
|
|||
to actually publish you have to set '-f' (force) flag in do-release.sh or do-release-docker.sh.
|
||||
|
||||
Used only for 'tag':
|
||||
YETUS_HOME - installation location for Apache Yetus
|
||||
GIT_NAME - Name to use with git
|
||||
GIT_EMAIL - E-mail address to use with git
|
||||
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'
|
|||
rm -rf "${PROJECT}"
|
||||
|
||||
if [[ "$1" == "tag" ]]; then
|
||||
init_yetus
|
||||
# for 'tag' stage
|
||||
set -o pipefail
|
||||
set -x # detailed logging during action
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#
|
||||
DRY_RUN=${DRY_RUN:-1} #default to dry run
|
||||
GPG="gpg --pinentry-mode loopback --no-tty --batch"
|
||||
YETUS_VERSION=${YETUS_VERSION:-0.11.1}
|
||||
# Maven Profiles for publishing snapshots and release to Maven Central and Dist
|
||||
PUBLISH_PROFILES=("-P" "apache-release,release")
|
||||
|
||||
|
@ -349,6 +348,16 @@ function init_mvn {
|
|||
configure_maven
|
||||
}
|
||||
|
||||
function init_yetus {
|
||||
declare YETUS_VERSION
|
||||
if [ -z "${YETUS_HOME}" ]; then
|
||||
error "Missing Apache Yetus."
|
||||
fi
|
||||
# Work around yetus bug by asking test-patch for the version instead of rdm.
|
||||
YETUS_VERSION=$("${YETUS_HOME}/bin/test-patch" --version)
|
||||
echo "Apache Yetus version ${YETUS_VERSION}"
|
||||
}
|
||||
|
||||
function configure_maven {
|
||||
# Add timestamps to mvn logs.
|
||||
MAVEN_OPTS="-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss ${MAVEN_OPTS}"
|
||||
|
@ -423,17 +432,15 @@ function get_jira_name {
|
|||
|
||||
# Update the CHANGES.md
|
||||
# DOES NOT DO COMMITS! Caller should do that.
|
||||
# requires yetus to have a defined home already.
|
||||
# yetus requires python2 to be on the path.
|
||||
function update_releasenotes {
|
||||
local project_dir="$1"
|
||||
local jira_fix_version="$2"
|
||||
local yetus="apache-yetus-${YETUS_VERSION}"
|
||||
local jira_project
|
||||
jira_project="$(get_jira_name "$(basename "$project_dir")")"
|
||||
wget -qO- "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=/yetus/${YETUS_VERSION}/${yetus}-bin.tar.gz" | \
|
||||
tar xvz -C . || exit
|
||||
cd "./${yetus}" || exit
|
||||
./bin/releasedocmaker -p "${jira_project}" --fileversions -v "${jira_fix_version}" -l --sortorder=newer --skip-credits
|
||||
"${YETUS_HOME}/bin/releasedocmaker" -p "${jira_project}" --fileversions -v "${jira_fix_version}" \
|
||||
-l --sortorder=newer --skip-credits
|
||||
pwd
|
||||
# First clear out the changes written by previous RCs.
|
||||
if [ -f "${project_dir}/CHANGES.md" ]; then
|
||||
|
@ -466,7 +473,6 @@ function update_releasenotes {
|
|||
else
|
||||
mv "RELEASENOTES.${jira_fix_version}.md" "${project_dir}/RELEASENOTES.md"
|
||||
fi
|
||||
cd .. || exit
|
||||
}
|
||||
|
||||
# Make src release.
|
||||
|
@ -608,3 +614,10 @@ function maven_deploy { #inputs: <snapshot|release> <log_file_path>
|
|||
echo "BUILD SUCCESS."
|
||||
return 0
|
||||
}
|
||||
|
||||
# guess the host os
|
||||
# * DARWIN
|
||||
# * LINUX
|
||||
function get_host_os() {
|
||||
uname -s | tr '[:lower:]' '[:upper:]'
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue