create-release 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. #!/usr/bin/env bash
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. if [[ -z "${BASH_VERSINFO[0]}" ]] \
  17. || [[ "${BASH_VERSINFO[0]}" -lt 3 ]] \
  18. || [[ "${BASH_VERSINFO[0]}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then
  19. echo "bash v3.2+ is required. Sorry."
  20. exit 1
  21. fi
  22. function centered_text
  23. {
  24. local text="$*"
  25. local spacing=$(( (75+${#text}) /2 ))
  26. printf "%*s\n" ${spacing} "${text}"
  27. }
  28. function big_console_header
  29. {
  30. printf "\n\n"
  31. echo "****************************************************************************"
  32. centered_text "${@}"
  33. echo "****************************************************************************"
  34. printf "\n\n"
  35. }
  36. ## @description Given a filename or dir, return the absolute version of it
  37. ## @audience public
  38. ## @stability stable
  39. ## @param directory
  40. ## @replaceable no
  41. ## @return 0 success
  42. ## @return 1 failure
  43. ## @return stdout abspath
  44. function hadoop_abs
  45. {
  46. declare obj=$1
  47. declare dir
  48. declare fn
  49. if [[ ! -e ${obj} ]]; then
  50. return 1
  51. elif [[ -d ${obj} ]]; then
  52. dir=${obj}
  53. else
  54. dir=$(dirname -- "${obj}")
  55. fn=$(basename -- "${obj}")
  56. fn="/${fn}"
  57. fi
  58. dir=$(cd -P -- "${dir}" >/dev/null 2>/dev/null && pwd -P)
  59. if [[ $? = 0 ]]; then
  60. echo "${dir}${fn}"
  61. return 0
  62. fi
  63. return 1
  64. }
  65. ## @description Print a message to stderr
  66. ## @audience public
  67. ## @stability stable
  68. ## @replaceable no
  69. ## @param string
  70. function hadoop_error
  71. {
  72. echo "$*" 1>&2
  73. }
  74. function run_and_redirect
  75. {
  76. declare logfile=$1
  77. shift
  78. declare res
  79. echo "\$ ${*} > ${logfile} 2>&1"
  80. # to the log
  81. {
  82. date
  83. echo "cd $(pwd)"
  84. echo "${*}"
  85. } > "${logfile}"
  86. # run the actual command
  87. "${@}" >> "${logfile}" 2>&1
  88. res=$?
  89. if [[ ${res} != 0 ]]; then
  90. echo
  91. echo "Failed!"
  92. echo
  93. exit "${res}"
  94. fi
  95. }
  96. function hadoop_native_flags
  97. {
  98. # modified version of the Yetus personality
  99. if [[ ${NATIVE} != true ]]; then
  100. return
  101. fi
  102. # Based upon HADOOP-11937
  103. #
  104. # Some notes:
  105. #
  106. # - getting fuse to compile on anything but Linux
  107. # is always tricky.
  108. # - Darwin assumes homebrew is in use.
  109. # - HADOOP-12027 required for bzip2 on OS X.
  110. # - bzip2 is broken in lots of places.
  111. # e.g, HADOOP-12027 for OS X. so no -Drequire.bzip2
  112. #
  113. case "${OSNAME}" in
  114. Linux)
  115. # shellcheck disable=SC2086
  116. echo -Pnative -Drequire.snappy -Drequire.openssl -Drequire.fuse
  117. ;;
  118. Darwin)
  119. echo \
  120. -Pnative -Drequire.snappy \
  121. -Drequire.openssl \
  122. -Dopenssl.prefix=/usr/local/opt/openssl/ \
  123. -Dopenssl.include=/usr/local/opt/openssl/include \
  124. -Dopenssl.lib=/usr/local/opt/openssl/lib
  125. ;;
  126. *)
  127. # shellcheck disable=SC2086
  128. echo \
  129. -Pnative \
  130. -Drequire.snappy -Drequire.openssl \
  131. -Drequire.test.libhadoop
  132. ;;
  133. esac
  134. }
  135. # Function to probe the exit code of the script commands,
  136. # and stop in the case of failure with an contextual error
  137. # message.
  138. function run()
  139. {
  140. declare res
  141. declare logfile
  142. echo "\$ ${*}"
  143. "${@}"
  144. res=$?
  145. if [[ ${res} != 0 ]]; then
  146. echo
  147. echo "Failed!"
  148. echo
  149. exit "${res}"
  150. fi
  151. }
  152. ## @description set JAVA_HOME properly
  153. ## @audience public
  154. ## @stability unstable
  155. function locate_jvm()
  156. {
  157. JAVA_HOME="$(ls -d /usr/lib/jvm/*${JVM_VERSION}* | grep "${JVM_HINT}" | head -1 )"
  158. export JAVA_HOME
  159. }
  160. function header()
  161. {
  162. echo
  163. printf "\n\n"
  164. echo "============================================================================"
  165. echo "============================================================================"
  166. centered_text "Hadoop Release Creator"
  167. echo "============================================================================"
  168. echo "============================================================================"
  169. printf "\n\n"
  170. echo "Version to create : ${HADOOP_VERSION}"
  171. echo "Release Candidate Label: ${RC_LABEL##-}"
  172. echo "Source Version : ${DEFAULT_HADOOP_VERSION}"
  173. echo "Using JDK : ${JAVA_HOME}"
  174. printf "\n\n"
  175. }
  176. function set_defaults
  177. {
  178. BINDIR=$(dirname "${BIN}")
  179. BASEDIR=$(hadoop_abs "${BINDIR}/../..")
  180. ARTIFACTS_DIR="${BASEDIR}/target/artifacts"
  181. # Extract Hadoop version from ${BASEDIR}/pom.xml
  182. DEFAULT_HADOOP_VERSION=$(grep "<version>" "${BASEDIR}/pom.xml" \
  183. | head -1 \
  184. | sed -e 's|^ *<version>||' -e 's|</version>.*$||')
  185. DOCKER=false
  186. DOCKERCACHE=false
  187. DOCKERFILE="${BASEDIR}/dev-support/docker/Dockerfile"
  188. DOCKERRAN=false
  189. # Extract Java version from ${BASEDIR}/pom.xml
  190. # doing this outside of maven means we can do this before
  191. # the docker container comes up...
  192. JVM_VERSION=$(grep "<javac.version>" "${BASEDIR}/hadoop-project/pom.xml" \
  193. | head -1 \
  194. | sed -e 's|^ *<javac.version>||' -e 's|</javac.version>.*$||' -e 's|..||')
  195. GIT=$(command -v git)
  196. GPG=$(command -v gpg)
  197. GPGAGENT=$(command -v gpg-agent)
  198. HADOOP_VERSION="${DEFAULT_HADOOP_VERSION}"
  199. INDOCKER=false
  200. LOGDIR="${BASEDIR}/patchprocess"
  201. if [[ -z "${MVN}" ]]; then
  202. if [[ -n "${MAVEN_HOME}" ]]; then
  203. MVN=${MAVEN_HOME}/bin/mvn
  204. else
  205. MVN=$(command -v mvn)
  206. fi
  207. fi
  208. NATIVE=false
  209. OSNAME=$(uname -s)
  210. PUBKEYFILE="https://dist.apache.org/repos/dist/release/hadoop/common/KEYS"
  211. SIGN=false
  212. }
  213. function startgpgagent
  214. {
  215. if [[ "${SIGN}" = true ]]; then
  216. if [[ -n "${GPGAGENT}" && -z "${GPG_AGENT_INFO}" ]]; then
  217. echo "starting gpg agent"
  218. echo "default-cache-ttl 36000" > "${LOGDIR}/gpgagent.conf"
  219. echo "max-cache-ttl 36000" >> "${LOGDIR}/gpgagent.conf"
  220. # shellcheck disable=2046
  221. eval $("${GPGAGENT}" --daemon \
  222. --options "${LOGDIR}/gpgagent.conf" \
  223. --log-file="${LOGDIR}/create-release-gpgagent.log")
  224. GPGAGENTPID=$(echo "${GPG_AGENT_INFO}" | cut -f 2 -d:)
  225. fi
  226. if [[ -n "${GPG_AGENT_INFO}" ]]; then
  227. echo "Warming the gpg-agent cache prior to calling maven"
  228. # warm the agent's cache:
  229. touch "${LOGDIR}/warm"
  230. ${GPG} --use-agent --armor --output "${LOGDIR}/warm.asc" --detach-sig "${LOGDIR}/warm"
  231. rm "${LOGDIR}/warm.asc" "${LOGDIR}/warm"
  232. else
  233. SIGN=false
  234. hadoop_error "ERROR: Unable to launch or acquire gpg-agent. Disable signing."
  235. fi
  236. fi
  237. }
  238. function stopgpgagent
  239. {
  240. if [[ -n "${GPGAGENTPID}" ]]; then
  241. kill "${GPGAGENTPID}"
  242. fi
  243. }
  244. function usage
  245. {
  246. echo "--artifactsdir=[path] Path to use to store release bits"
  247. echo "--asfrelease Make an ASF release"
  248. echo "--docker Use Hadoop's Dockerfile for guaranteed environment"
  249. echo "--dockercache Use a Docker-private maven cache"
  250. echo "--jvmhint=[filter] Simple filter to pick a JVM to use"
  251. echo "--logdir=[path] Path to store logs"
  252. echo "--mvncache=[path] Path to the maven cache to use"
  253. echo "--native Also build the native components"
  254. echo "--rc-label=[label] Add this label to the builds"
  255. echo "--sign Use .gnupg dir to sign the artifacts and jars"
  256. echo "--version=[version] Use an alternative version string"
  257. }
  258. function option_parse
  259. {
  260. declare i
  261. for i in "$@"; do
  262. case ${i} in
  263. --asfrelease)
  264. ASFRELEASE=true
  265. NATIVE=true
  266. SIGN=true
  267. ;;
  268. --artifactsdir=*)
  269. ARTIFACTS_DIR=${i#*=}
  270. ;;
  271. --docker)
  272. DOCKER=true
  273. ;;
  274. --dockercache)
  275. DOCKERCACHE=true
  276. ;;
  277. --help)
  278. usage
  279. exit
  280. ;;
  281. --indocker)
  282. INDOCKER=true
  283. ;;
  284. --jvmhint=*)
  285. JVM_HINT=${i#*=}
  286. ;;
  287. --logdir=*)
  288. LOGDIR=${i#*=}
  289. ;;
  290. --mvncache=*)
  291. MVNCACHE=${i#*=}
  292. ;;
  293. --native)
  294. NATIVE=true
  295. ;;
  296. --rc-label=*)
  297. RC_LABEL=${i#*=}
  298. ;;
  299. --sign)
  300. SIGN=true
  301. ;;
  302. --version=*)
  303. HADOOP_VERSION=${i#*=}
  304. ;;
  305. esac
  306. done
  307. if [[ ! -d "${HOME}/.gnupg" ]]; then
  308. hadoop_error "ERROR: No .gnupg dir. Disabling signing capability."
  309. SIGN=false
  310. fi
  311. if [[ "${SIGN}" = true ]]; then
  312. if [[ -n "${GPG_AGENT_INFO}" ]]; then
  313. echo "NOTE: Using existing gpg-agent. If the default-cache-ttl"
  314. echo "is set to less than ~20 mins, maven commands will fail."
  315. elif [[ -z "${GPGAGENT}" ]]; then
  316. hadoop_error "ERROR: No gpg-agent. Disabling signing capability."
  317. SIGN=false
  318. fi
  319. fi
  320. DOCKERCMD=$(command -v docker)
  321. if [[ "${DOCKER}" = true && -z "${DOCKERCMD}" ]]; then
  322. hadoop_error "ERROR: docker binary not found. Disabling docker mode."
  323. DOCKER=false
  324. fi
  325. if [[ "${DOCKERCACHE}" = true && "${DOCKER}" = false ]]; then
  326. if [[ "${INDOCKER}" = false ]]; then
  327. hadoop_error "ERROR: docker mode not enabled. Disabling dockercache."
  328. fi
  329. DOCKERCACHE=false
  330. fi
  331. if [[ "${DOCKERCACHE}" = true && -n "${MVNCACHE}" ]]; then
  332. hadoop_error "ERROR: Cannot set --mvncache and --dockercache simultaneously."
  333. exit 1
  334. else
  335. MVNCACHE=${MVNCACHE:-"${HOME}/.m2"}
  336. fi
  337. if [[ "${ASFRELEASE}" = true ]]; then
  338. if [[ "${SIGN}" = false ]]; then
  339. hadoop_error "ERROR: --asfrelease requires --sign. Exiting."
  340. exit 1
  341. fi
  342. if [[ "${OSNAME}" = Linux ]]; then
  343. if [[ "${DOCKER}" = false && "${INDOCKER}" = false ]]; then
  344. hadoop_error "ERROR: --asfrelease requires --docker on Linux. Exiting."
  345. exit 1
  346. elif [[ "${DOCKERCACHE}" = false && "${INDOCKER}" = false ]]; then
  347. hadoop_error "ERROR: --asfrelease on Linux requires --dockercache. Exiting."
  348. exit 1
  349. fi
  350. fi
  351. fi
  352. if [[ -n "${MVNCACHE}" ]]; then
  353. mkdir -p "${MVNCACHE}"
  354. if [[ -d "${MVNCACHE}" ]]; then
  355. MVN_ARGS=("-Dmaven.repo.local=${MVNCACHE}")
  356. fi
  357. fi
  358. }
  359. function dockermode
  360. {
  361. declare lines
  362. declare -a modp
  363. declare imgname
  364. declare -a extrad
  365. declare user_name
  366. declare group_id
  367. if [[ "${DOCKER}" != true ]]; then
  368. return
  369. fi
  370. user_name=${SUDO_USER:=$USER}
  371. user_id=$(id -u "${user_name}")
  372. group_id=$(id -g "${user_name}")
  373. imgname="hadoop/createrelease:${HADOOP_VERSION}_${RANDOM}"
  374. if [[ -d "${HOME}/.gnupg" ]]; then
  375. extrad+=("-v" "${HOME}/.gnupg:/home/${user_name}/.gnupg")
  376. fi
  377. if [[ -n "${LOGDIR}" ]]; then
  378. if [[ ! -d "${LOGDIR}" ]]; then
  379. mkdir -p "${LOGDIR}"
  380. fi
  381. lines=$(hadoop_abs "${LOGDIR}")
  382. extrad+=("-v" "${lines}:${lines}")
  383. fi
  384. if [[ -n "${ARTIFACTS_DIR}" ]]; then
  385. if [[ ! -d "${ARTIFACTS_DIR}" ]]; then
  386. mkdir -p "${ARTIFACTS_DIR}"
  387. fi
  388. lines=$(hadoop_abs "${ARTIFACTS_DIR}")
  389. extrad+=("-v" "${lines}:${lines}")
  390. fi
  391. if [[ "${DOCKERCACHE}" = true ]]; then
  392. modp+=("--mvncache=/maven")
  393. else
  394. lines=$(hadoop_abs "${MVNCACHE}")
  395. extrad+=("-v" "${lines}:${lines}")
  396. fi
  397. for lines in "${PARAMS[@]}"; do
  398. if [[ "${lines}" != "--docker" ]]; then
  399. modp+=("$lines")
  400. fi
  401. done
  402. modp+=("--indocker")
  403. (
  404. lines=$(grep -n 'YETUS CUT HERE' "${DOCKERFILE}" | cut -f1 -d:)
  405. if [[ -z "${lines}" ]]; then
  406. cat "${DOCKERFILE}"
  407. else
  408. head -n "${lines}" "${DOCKERFILE}"
  409. fi
  410. # make sure we put some space between, just in case last
  411. # line isn't an empty line or whatever
  412. printf "\n\n"
  413. # force a new image for every run to make it easier to remove later
  414. echo "LABEL org.apache.hadoop.create-release=\"cr-${RANDOM}\""
  415. # setup ownerships, etc
  416. echo "RUN groupadd --non-unique -g ${group_id} ${user_name}"
  417. echo "RUN useradd -g ${group_id} -u ${user_id} -m ${user_name}"
  418. echo "RUN chown -R ${user_name} /home/${user_name}"
  419. echo "ENV HOME /home/${user_name}"
  420. echo "RUN mkdir -p /maven"
  421. echo "RUN chown -R ${user_name} /maven"
  422. echo "USER ${user_name}"
  423. printf "\n\n"
  424. ) | docker build -t "${imgname}" -
  425. run docker run -i -t \
  426. --privileged \
  427. "${extrad[@]}" \
  428. -v "${BASEDIR}:/build/source" \
  429. -u "${user_name}" \
  430. -w "/build/source" \
  431. "${imgname}" \
  432. "/build/source/dev-support/bin/create-release" "${modp[@]}"
  433. DOCKERRAN=true
  434. }
  435. function makearelease
  436. {
  437. # let's start at the root
  438. run cd "${BASEDIR}"
  439. big_console_header "Cleaning the Source Tree"
  440. # git clean to clear any remnants from previous build
  441. run "${GIT}" clean -xdf -e /patchprocess
  442. mkdir -p "${LOGDIR}"
  443. # Install the Hadoop maven plugins first
  444. run_and_redirect "${LOGDIR}/mvn_install_maven_plugins.log" "${MVN}" "${MVN_ARGS[@]}" -pl hadoop-maven-plugins -am clean install
  445. # mvn clean for sanity
  446. run_and_redirect "${LOGDIR}/mvn_clean.log" "${MVN}" "${MVN_ARGS[@]}" clean
  447. # Create staging dir for release artifacts
  448. run mkdir -p "${ARTIFACTS_DIR}"
  449. big_console_header "Apache RAT Check"
  450. # Create RAT report
  451. run_and_redirect "${LOGDIR}/mvn_apache_rat.log" "${MVN}" "${MVN_ARGS[@]}" apache-rat:check
  452. big_console_header "Maven Build and Install"
  453. if [[ "${SIGN}" = true ]]; then
  454. signflags=("-Psign" "-Dgpg.useagent=true" -Dgpg.executable="${GPG}")
  455. fi
  456. # Create SRC and BIN tarballs for release,
  457. # shellcheck disable=SC2046
  458. run_and_redirect "${LOGDIR}/mvn_install.log" \
  459. "${MVN}" "${MVN_ARGS[@]}" install \
  460. -Pdist,src,yarn-ui \
  461. "${signflags[@]}" \
  462. -DskipTests -Dtar $(hadoop_native_flags)
  463. # Create site for release
  464. # we need to do install again so that jdiff and
  465. # a few other things get registered in the maven
  466. # universe correctly
  467. run_and_redirect "${LOGDIR}/mvn_site.log" \
  468. "${MVN}" "${MVN_ARGS[@]}" install \
  469. site site:stage \
  470. -DskipTests \
  471. -Pdist,src,releasedocs,docs
  472. big_console_header "Staging the release"
  473. run mv "${BASEDIR}/target/staging/hadoop-project" "${BASEDIR}/target/r${HADOOP_VERSION}/"
  474. run cd "${BASEDIR}/target/"
  475. run tar czpf "hadoop-site-${HADOOP_VERSION}.tar.gz" "r${HADOOP_VERSION}"/*
  476. run cd "${BASEDIR}"
  477. # Stage RAT report
  478. #shellcheck disable=SC2038
  479. find . -name rat.txt | xargs -I% cat % > "${ARTIFACTS_DIR}/hadoop-${HADOOP_VERSION}${RC_LABEL}-rat.txt"
  480. # Stage CHANGELOG and RELEASENOTES files
  481. for i in CHANGELOG RELEASENOTES; do
  482. run cp -p \
  483. "${BASEDIR}/hadoop-common-project/hadoop-common/src/site/markdown/release/${HADOOP_VERSION}"/${i}*.md \
  484. "${ARTIFACTS_DIR}/${i}.md"
  485. done
  486. # Prepare and stage BIN tarball
  487. run cd "${BASEDIR}/hadoop-dist/target/"
  488. run tar -xzpf "hadoop-${HADOOP_VERSION}.tar.gz"
  489. run mkdir -p "hadoop-${HADOOP_VERSION}/share/doc/hadoop/"
  490. run cp -r "${BASEDIR}/target/r${HADOOP_VERSION}"/* "hadoop-${HADOOP_VERSION}/share/doc/hadoop/"
  491. run tar -czpf "hadoop-${HADOOP_VERSION}.tar.gz" "hadoop-${HADOOP_VERSION}"
  492. run cd "${BASEDIR}"
  493. run mv \
  494. "${BASEDIR}/hadoop-dist/target/hadoop-${HADOOP_VERSION}.tar.gz" \
  495. "${ARTIFACTS_DIR}/hadoop-${HADOOP_VERSION}${RC_LABEL}.tar.gz"
  496. # Stage SRC tarball
  497. run mv \
  498. "${BASEDIR}/hadoop-dist/target/hadoop-${HADOOP_VERSION}-src.tar.gz" \
  499. "${ARTIFACTS_DIR}/hadoop-${HADOOP_VERSION}${RC_LABEL}-src.tar.gz"
  500. # Stage SITE tarball
  501. run mv \
  502. "${BASEDIR}/target/hadoop-site-${HADOOP_VERSION}.tar.gz" \
  503. "${ARTIFACTS_DIR}/hadoop-${HADOOP_VERSION}${RC_LABEL}-site.tar.gz"
  504. }
  505. function signartifacts
  506. {
  507. declare i
  508. if [[ "${SIGN}" = false ]]; then
  509. echo ""
  510. echo "Remember to sign the artifacts before staging them on the open"
  511. echo ""
  512. return
  513. fi
  514. big_console_header "Signing the release"
  515. for i in ${ARTIFACTS_DIR}/*; do
  516. ${GPG} --use-agent --armor --output "${i}.asc" --detach-sig "${i}"
  517. sha512sum --tag "${i}" > "${i}.sha512"
  518. done
  519. if [[ "${ASFRELEASE}" = true ]]; then
  520. echo "Fetching the Apache Hadoop KEYS file..."
  521. curl -L "${PUBKEYFILE}" -o "${BASEDIR}/target/KEYS"
  522. ${GPG} --import --trustdb "${BASEDIR}/target/testkeysdb" "${BASEDIR}/target/KEYS"
  523. ${GPG} --verify --trustdb "${BASEDIR}/target/testkeysdb" \
  524. "${ARTIFACTS_DIR}/hadoop-${HADOOP_VERSION}${RC_LABEL}.tar.gz.asc" \
  525. "${ARTIFACTS_DIR}/hadoop-${HADOOP_VERSION}${RC_LABEL}.tar.gz"
  526. if [[ $? != 0 ]]; then
  527. hadoop_error "ERROR: GPG key is not present in ${PUBKEYFILE}."
  528. hadoop_error "ERROR: This MUST be fixed. Exiting."
  529. exit 1
  530. fi
  531. fi
  532. }
  533. # find root of the source tree
  534. BIN=$(hadoop_abs "${BASH_SOURCE:-$0}")
  535. PARAMS=("$@")
  536. set_defaults
  537. option_parse "${PARAMS[@]}"
  538. dockermode
  539. locate_jvm
  540. header
  541. if [[ -n ${RC_LABEL} ]]; then
  542. RC_LABEL="-${RC_LABEL}"
  543. fi
  544. if [[ "${INDOCKER}" = true || "${DOCKERRAN}" = false ]]; then
  545. startgpgagent
  546. makearelease
  547. signartifacts
  548. stopgpgagent
  549. fi
  550. if [[ "${INDOCKER}" = true ]]; then
  551. exit $?
  552. fi
  553. if [[ $? == 0 ]]; then
  554. echo
  555. echo "Congratulations, you have successfully built the release"
  556. echo "artifacts for Apache Hadoop ${HADOOP_VERSION}${RC_LABEL}"
  557. echo
  558. echo "The artifacts for this run are available at ${ARTIFACTS_DIR}:"
  559. run ls -1 "${ARTIFACTS_DIR}"
  560. echo
  561. fi