]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/dev/release/post-01-upload.sh
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / dev / release / post-01-upload.sh
CommitLineData
1d09f67e
TL
1#!/usr/bin/env 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#
20set -e
21set -u
22
23if [ "$#" -ne 2 ]; then
24 echo "Usage: $0 <version> <rc-num>"
25 exit
26fi
27
28version=$1
29rc=$2
30
31tmp_dir=tmp-apache-arrow-dist
32
33echo "Recreate temporary directory: ${tmp_dir}"
34rm -rf ${tmp_dir}
35mkdir -p ${tmp_dir}
36
37echo "Clone dev dist repository"
38svn \
39 co \
40 https://dist.apache.org/repos/dist/dev/arrow/apache-arrow-${version}-rc${rc} \
41 ${tmp_dir}/dev
42
43echo "Clone release dist repository"
44svn co https://dist.apache.org/repos/dist/release/arrow ${tmp_dir}/release
45
46echo "Copy ${version}-rc${rc} to release working copy"
47release_version=arrow-${version}
48mkdir -p ${tmp_dir}/release/${release_version}
49cp -r ${tmp_dir}/dev/* ${tmp_dir}/release/${release_version}/
50svn add ${tmp_dir}/release/${release_version}
51
52echo "Keep only the three most recent versions"
53old_releases=$(
54 svn ls ${tmp_dir}/release/ | \
55 grep -E '^arrow-[0-9\.]+' | \
56 sort --version-sort --reverse | \
57 tail -n +4
58)
59for old_release_version in $old_releases; do
60 echo "Remove old release ${old_release_version}"
61 svn delete ${tmp_dir}/release/${old_release_version}
62done
63
64echo "Commit release"
65svn ci -m "Apache Arrow ${version}" ${tmp_dir}/release
66
67echo "Clean up"
68rm -rf ${tmp_dir}
69
70echo "Success! The release is available here:"
71echo " https://dist.apache.org/repos/dist/release/arrow/${release_version}"