|
| 1 | +#!/bin/bash |
| 2 | +# |
| 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 |
| 10 | +# |
| 11 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +# |
| 13 | +# Unless required by applicable law or agreed to in writing, |
| 14 | +# software distributed under the License is distributed on an |
| 15 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | +# KIND, either express or implied. See the License for the |
| 17 | +# specific language governing permissions and limitations |
| 18 | +# under the License. |
| 19 | +# |
| 20 | + |
| 21 | +version=$1 |
| 22 | +rc=$2 |
| 23 | + |
| 24 | +if [ -z "$version" ]; then |
| 25 | + echo "Usage: $0 <version> <rc-num>" |
| 26 | + exit |
| 27 | +fi |
| 28 | + |
| 29 | +if [ -z "$rc" ]; then |
| 30 | + echo "Usage: $0 <version> <rc-num>" |
| 31 | + exit |
| 32 | +fi |
| 33 | + |
| 34 | +if [ -d tmp/ ]; then |
| 35 | + echo "Cannot run: tmp/ exists" |
| 36 | + exit |
| 37 | +fi |
| 38 | + |
| 39 | +tag=apache-parquet-format-$version-incubating |
| 40 | +tagrc=${tag}-rc${rc} |
| 41 | + |
| 42 | +echo "Preparing source for $tagrc" |
| 43 | + |
| 44 | +release_hash=`git rev-list $tag 2> /dev/null | head -n 1 ` |
| 45 | + |
| 46 | +if [ -z "$release_hash" ]; then |
| 47 | + echo "Cannot continue: unknown git tag: $tag" |
| 48 | + exit |
| 49 | +fi |
| 50 | + |
| 51 | +echo "Using commit $release_hash" |
| 52 | + |
| 53 | +tarball=$tag.tar.gz |
| 54 | + |
| 55 | +# be conservative and use the release hash, even though git produces the same |
| 56 | +# archive (identical hashes) using the scm tag |
| 57 | +git archive $release_hash --prefix $tag/ -o $tarball |
| 58 | + |
| 59 | +# sign the archive |
| 60 | +gpg --armor --output ${tarball}.asc --detach-sig $tarball |
| 61 | +gpg --print-md MD5 $tarball > ${tarball}.md5 |
| 62 | +shasum $tarball > ${tarball}.sha |
| 63 | + |
| 64 | +# check out the parquet RC folder |
| 65 | +svn co --depth=empty https://dist.apache.org/repos/dist/dev/incubator/parquet tmp |
| 66 | + |
| 67 | +# add the release candidate for the tag |
| 68 | +mkdir -p tmp/$tagrc |
| 69 | +cp ${tarball}* tmp/$tagrc |
| 70 | +svn add tmp/$tagrc |
| 71 | +svn ci -m "Apache Parquet Format (Incubating) $version RC${rc}" tmp/$tagrc |
| 72 | + |
| 73 | +# clean up |
| 74 | +rm -rf tmp |
| 75 | + |
| 76 | +echo "Success! The release candidate is available here:" |
| 77 | +echo " https://dist.apache.org/repos/dist/dev/incubator/parquet/$tagrc" |
| 78 | +echo "" |
| 79 | +echo "Commit SHA1: $release_hash" |
| 80 | + |
0 commit comments