Preparing hbase release 2.4.1RC1; tagging and updates to CHANGES.md again
[hbase.git] / dev-support / make_rc.sh
blob73691791f6aaaed52c5675271875e92b87871d2c
1 #!/bin/bash
3 # Licensed to the Apache Software Foundation (ASF) under one
4 # or more contributor license agreements. See the NOTICE file
5 # distributed with this work for additional information
6 # regarding copyright ownership. The ASF licenses this file
7 # to you under the Apache License, Version 2.0 (the
8 # "License"); you may not use this file except in compliance
9 # with 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.
19 # Script that assembles all you need to make an RC. Does build of the tar.gzs
20 # which it stashes into a dir above $(pwd) named for the script with a
21 # timestamp suffix. Deploys builds to maven.
23 # To finish, check what was build. If good copy to people.apache.org and
24 # close the maven repos. Call a vote.
26 # Presumes that dev-support/generate-hadoopX-poms.sh has already been run.
27 # Presumes your settings.xml all set up so can sign artifacts published to mvn, etc.
29 set -e -x
31 # Script checks out a tag, cleans the checkout and then builds src and bin
32 # tarballs. It then deploys to the apache maven repository.
33 # Presumes run from git dir.
35 # Need a git tag to build.
36 if [ "$1" = "" ]
37 then
38 echo -n "Usage: $0 TAG_TO_PACKAGE"
39 exit 1
41 git_tag=$1
43 # Set mvn and mvnopts
44 mvn=mvn
45 if [ "$MAVEN" != "" ]; then
46 mvn="${MAVEN}"
48 mvnopts="-Xmx3g"
49 if [ "$MAVEN_OPTS" != "" ]; then
50 mvnopts="${MAVEN_OPTS}"
53 # Ensure we are inside a git repo before making progress
54 # The below will fail if outside git.
55 git -C . rev-parse
57 # Checkout git_tag
58 git checkout "${git_tag}"
60 # Get mvn protject version
61 #shellcheck disable=SC2016
62 version=$(${mvn} -q -N -Dexec.executable="echo" -Dexec.args='${project.version}' exec:exec)
63 hbase_name="hbase-${version}"
65 # Make a dir to save tgzs into.
66 d=`date -u +"%Y%m%dT%H%M%SZ"`
67 output_dir="/${TMPDIR}/$hbase_name.$d"
68 mkdir -p "${output_dir}"
71 # Build src tgz.
72 function build_src {
73 git archive --format=tar.gz --output="${output_dir}/${hbase_name}-src.tar.gz" --prefix="${hbase_name}/" "${git_tag}"
76 # Build bin tgz
77 function build_bin {
78 MAVEN_OPTS="${mvnopts}" ${mvn} clean install -DskipTests \
79 -Papache-release -Prelease \
80 -Dmaven.repo.local=${output_dir}/repository
81 MAVEN_OPTS="${mvnopts}" ${mvn} install -DskipTests \
82 -Dcheckstyle.skip=true site assembly:single \
83 -Papache-release -Prelease \
84 -Dmaven.repo.local=${output_dir}/repository
85 mv ./hbase-assembly/target/hbase-*.tar.gz "${output_dir}"
88 # Make sure all clean.
89 git clean -f -x -d
90 MAVEN_OPTS="${mvnopts}" ${mvn} clean
92 # Now do the two builds, one for hadoop1, then hadoop2
93 # Run a rat check.
94 ${mvn} apache-rat:check
96 #Build src.
97 build_src
99 # Build bin product
100 build_bin
102 # Deploy to mvn repository
103 # Depends on build_bin having populated the local repository
104 # If the below upload fails, you will probably have to clean the partial
105 # upload from repository.apache.org by 'drop'ping it from the staging
106 # repository before restart.
107 MAVEN_OPTS="${mvnopts}" ${mvn} deploy -DskipTests -Papache-release -Prelease \
108 -Dmaven.repo.local=${output_dir}/repository
110 # Do sha512 and md5
111 cd ${output_dir}
112 for i in *.tar.gz; do echo $i; gpg --print-md SHA512 $i > $i.sha512 ; done
114 echo "Check the content of ${output_dir}. If good, sign and push to dist.apache.org"
115 echo " cd ${output_dir}"
116 echo ' for i in *.tar.gz; do echo $i; gpg --armor --output $i.asc --detach-sig $i ; done'
117 echo " rsync -av ${output_dir}/*.gz ${output_dir}/*.sha512 ${output_dir}/*.asc ${APACHE_HBASE_DIST_DEV_DIR}/${hbase_name}/"
118 echo "Check the content deployed to maven. If good, close the repo and record links of temporary staging repo"