4 # Licensed to the Apache Software Foundation (ASF) under one or more
5 # contributor license agreements. See the NOTICE file distributed with
6 # this work for additional information regarding copyright ownership.
7 # The ASF licenses this file to You under the Apache License, Version 2.0
8 # (the "License"); you may not use this file except in compliance with
9 # the License. You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
20 # Use the adjacent do-release-docker.sh instead, if you can.
21 # Otherwise, this runs core of the release creation.
22 # Will ask you questions on what to build and for logins
23 # and passwords to use building.
24 export PROJECT
="${PROJECT:-hbase}"
26 SELF
=$
(cd $
(dirname $0) && pwd)
27 .
"$SELF/release-util.sh"
29 while getopts "bn" opt
; do
31 b
) GIT_BRANCH
=$OPTARG ;;
33 ?
) error
"Invalid option: $OPTARG" ;;
37 # If running in docker, import and then cache keys.
38 if [ "$RUNNING_IN_DOCKER" = "1" ]; then
40 eval $
(gpg-agent
--disable-scdaemon --daemon --no-grab --allow-preset-passphrase --default-cache-ttl=86400 --max-cache-ttl=86400)
41 echo "GPG Version: `gpg --version`"
42 # Inside docker, need to import the GPG key stored in the current directory.
43 echo $GPG_PASSPHRASE |
$GPG --passphrase-fd 0 --import "$SELF/gpg.key"
45 # We may need to adjust the path since JAVA_HOME may be overridden by the driver script.
46 if [ -n "$JAVA_HOME" ]; then
47 export PATH
="$JAVA_HOME/bin:$PATH"
49 # JAVA_HOME for the openjdk package.
53 # Outside docker, need to ask for information about the release.
58 function should_build
{
60 if [[ -z "$RELEASE_STEP" ]]; then
62 elif [[ "$RELEASE_STEP" == *"$WHAT"* ]]; then
69 if should_build
"tag" && [ $SKIP_TAG = 0 ]; then
70 run_silent
"Creating release tag $RELEASE_TAG..." "tag.log" \
71 "$SELF/release-tag.sh"
72 echo "It may take some time for the tag to be synchronized to github."
73 echo "Press enter when you've verified that the new tag ($RELEASE_TAG) is available."
76 echo "Skipping tag creation for $RELEASE_TAG."
79 if should_build
"build"; then
80 run_silent
"Building ${PROJECT}..." "build.log" \
81 "$SELF/release-build.sh" build
83 echo "Skipping build step."
86 if should_build
"publish"; then
87 run_silent
"Publishing release" "publish.log" \
88 "$SELF/release-build.sh" publish-release
90 echo "Skipping publish step."