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