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.
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.
38 echo -n "Usage: $0 TAG_TO_PACKAGE"
45 if [ "$MAVEN" != "" ]; then
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.
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}"
73 git archive
--format=tar.gz
--output="${output_dir}/${hbase_name}-src.tar.gz" --prefix="${hbase_name}/" "${git_tag}"
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.
90 MAVEN_OPTS
="${mvnopts}" ${mvn} clean
92 # Now do the two builds, one for hadoop1, then hadoop2
94 ${mvn} apache-rat
:check
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
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"