HBASE-23755. [OpenTracing] Declare HTrace is unusable in the user doc (#1196)
[hbase.git] / dev-support / create-release / do-release.sh
blob1c10dfc1dc0accac44e5849382607c5273acb2ed
1 #!/usr/bin/env bash
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
30 case $opt in
31 b) GIT_BRANCH=$OPTARG ;;
32 n) DRY_RUN=1 ;;
33 ?) error "Invalid option: $OPTARG" ;;
34 esac
35 done
37 # If running in docker, import and then cache keys.
38 if [ "$RUNNING_IN_DOCKER" = "1" ]; then
39 # Run gpg agent.
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"
48 else
49 # JAVA_HOME for the openjdk package.
50 export JAVA_HOME=/usr
52 else
53 # Outside docker, need to ask for information about the release.
54 get_release_info
56 export GPG_TTY=$(tty)
58 function should_build {
59 local WHAT=$1
60 if [[ -z "$RELEASE_STEP" ]]; then
61 return 0
62 elif [[ "$RELEASE_STEP" == *"$WHAT"* ]]; then
63 return 0
64 else
65 return 1
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."
74 read
75 else
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
82 else
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
89 else
90 echo "Skipping publish step."