Skip to content

Commit

Permalink
HADOOP-14602. allow custom release notes/changelog during create-release
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Douglas <[email protected]>
  • Loading branch information
aw-was-here committed Jun 29, 2017
1 parent 16c8dbd commit 0c52da7
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions dev-support/bin/create-release
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function hadoop_abs
declare obj=$1
declare dir
declare fn
declare ret

if [[ ! -e ${obj} ]]; then
return 1
Expand All @@ -62,7 +63,8 @@ function hadoop_abs
fi

dir=$(cd -P -- "${dir}" >/dev/null 2>/dev/null && pwd -P)
if [[ $? = 0 ]]; then
ret=$?
if [[ ${ret} = 0 ]]; then
echo "${dir}${fn}"
return 0
fi
Expand Down Expand Up @@ -287,6 +289,7 @@ function usage
echo "--mvncache=[path] Path to the maven cache to use"
echo "--native Also build the native components"
echo "--rc-label=[label] Add this label to the builds"
echo "--security Emergency security release"
echo "--sign Use .gnupg dir to sign the artifacts and jars"
echo "--version=[version] Use an alternative version string"
}
Expand Down Expand Up @@ -330,6 +333,9 @@ function option_parse
--rc-label=*)
RC_LABEL=${i#*=}
;;
--security)
SECURITYRELEASE=true
;;
--sign)
SIGN=true
;;
Expand Down Expand Up @@ -397,6 +403,14 @@ function option_parse
MVN_ARGS=("-Dmaven.repo.local=${MVNCACHE}")
fi
fi

if [[ "${SECURITYRELEASE}" = true ]]; then
if [[ ! -d "${BASEDIR}/hadoop-common-project/hadoop-common/src/site/markdown/release/${HADOOP_VERSION}" ]]; then
hadoop_error "ERROR: ${BASEDIR}/hadoop-common-project/hadoop-common/src/site/markdown/release/${HADOOP_VERSION} does not exist."
hadoop_error "ERROR: This directory and its contents are required to be manually created for a security release."
exit 1
fi
fi
}

function dockermode
Expand Down Expand Up @@ -523,7 +537,7 @@ function makearelease
big_console_header "Maven Build and Install"

if [[ "${SIGN}" = true ]]; then
signflags=("-Psign" "-Dgpg.useagent=true" -Dgpg.executable="${GPG}")
signflags=("-Psign" "-Dgpg.useagent=true" "-Dgpg.executable=${GPG}")
fi

# Create SRC and BIN tarballs for release,
Expand All @@ -534,6 +548,14 @@ function makearelease
"${signflags[@]}" \
-DskipTests -Dtar $(hadoop_native_flags)

if [[ "${SECURITYRELEASE}" = true ]]; then
DOCFLAGS="-Pdocs"
hadoop_error "WARNING: Skipping automatic changelog and release notes generation due to --security"
else
DOCFLAGS="-Preleasedocs,docs"
fi


# Create site for release
# we need to do install again so that jdiff and
# a few other things get registered in the maven
Expand All @@ -542,7 +564,8 @@ function makearelease
"${MVN}" "${MVN_ARGS[@]}" install \
site site:stage \
-DskipTests \
-Pdist,src,releasedocs,docs
-Pdist,src \
"${DOCFLAGS}"

big_console_header "Staging the release"

Expand Down Expand Up @@ -586,6 +609,7 @@ function makearelease
function signartifacts
{
declare i
declare ret

if [[ "${SIGN}" = false ]]; then
for i in ${ARTIFACTS_DIR}/*; do
Expand All @@ -612,7 +636,8 @@ function signartifacts
${GPG} --verify --trustdb "${BASEDIR}/target/testkeysdb" \
"${ARTIFACTS_DIR}/hadoop-${HADOOP_VERSION}${RC_LABEL}.tar.gz.asc" \
"${ARTIFACTS_DIR}/hadoop-${HADOOP_VERSION}${RC_LABEL}.tar.gz"
if [[ $? != 0 ]]; then
ret=$?
if [[ ${ret} != 0 ]]; then
hadoop_error "ERROR: GPG key is not present in ${PUBKEYFILE}."
hadoop_error "ERROR: This MUST be fixed. Exiting."
exit 1
Expand Down Expand Up @@ -641,6 +666,7 @@ if [[ "${INDOCKER}" = true || "${DOCKERRAN}" = false ]]; then
startgpgagent

makearelease
releaseret=$?

signartifacts

Expand All @@ -651,7 +677,7 @@ if [[ "${INDOCKER}" = true ]]; then
exit $?
fi

if [[ $? == 0 ]]; then
if [[ ${releaseret} == 0 ]]; then
echo
echo "Congratulations, you have successfully built the release"
echo "artifacts for Apache Hadoop ${HADOOP_VERSION}${RC_LABEL}"
Expand Down

0 comments on commit 0c52da7

Please sign in to comment.