4e7d8678a3
The "do-release.sh" script asks questions about the RC being prepared, trying to find out as much as possible automatically, and then executes the existing scripts with proper arguments to prepare the release. This script was used to prepare the 2.3.1 release candidates, so was tested in that context. The docker version runs that same script inside a docker image especially crafted for building Spark releases. That image is based on the work by Felix C. linked in the bug. At this point is has been only midly tested. I also added a template for the vote e-mail, with placeholders for things that need to be replaced, although there is no automation around that for the moment. It shouldn't be hard to hook up certain things like version and tags to this, or to figure out certain things like the repo URL from the output of the release scripts. Author: Marcelo Vanzin <vanzin@cloudera.com> Closes #21515 from vanzin/SPARK-24372.
82 lines
2.4 KiB
Bash
Executable file
82 lines
2.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
#
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
# this work for additional information regarding copyright ownership.
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
# (the "License"); you may not use this file except in compliance with
|
|
# the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
SELF=$(cd $(dirname $0) && pwd)
|
|
. "$SELF/release-util.sh"
|
|
|
|
while getopts "bn" opt; do
|
|
case $opt in
|
|
b) GIT_BRANCH=$OPTARG ;;
|
|
n) DRY_RUN=1 ;;
|
|
?) error "Invalid option: $OPTARG" ;;
|
|
esac
|
|
done
|
|
|
|
if [ "$RUNNING_IN_DOCKER" = "1" ]; then
|
|
# Inside docker, need to import the GPG key stored in the current directory.
|
|
echo $GPG_PASSPHRASE | $GPG --passphrase-fd 0 --import "$SELF/gpg.key"
|
|
|
|
# We may need to adjust the path since JAVA_HOME may be overridden by the driver script.
|
|
if [ -n "$JAVA_HOME" ]; then
|
|
export PATH="$JAVA_HOME/bin:$PATH"
|
|
else
|
|
# JAVA_HOME for the openjdk package.
|
|
export JAVA_HOME=/usr
|
|
fi
|
|
else
|
|
# Outside docker, need to ask for information about the release.
|
|
get_release_info
|
|
fi
|
|
|
|
function should_build {
|
|
local WHAT=$1
|
|
[ -z "$RELEASE_STEP" ] || [ "$WHAT" = "$RELEASE_STEP" ]
|
|
}
|
|
|
|
if should_build "tag" && [ $SKIP_TAG = 0 ]; then
|
|
run_silent "Creating release tag $RELEASE_TAG..." "tag.log" \
|
|
"$SELF/release-tag.sh"
|
|
echo "It may take some time for the tag to be synchronized to github."
|
|
echo "Press enter when you've verified that the new tag ($RELEASE_TAG) is available."
|
|
read
|
|
else
|
|
echo "Skipping tag creation for $RELEASE_TAG."
|
|
fi
|
|
|
|
if should_build "build"; then
|
|
run_silent "Building Spark..." "build.log" \
|
|
"$SELF/release-build.sh" package
|
|
else
|
|
echo "Skipping build step."
|
|
fi
|
|
|
|
if should_build "docs"; then
|
|
run_silent "Building documentation..." "docs.log" \
|
|
"$SELF/release-build.sh" docs
|
|
else
|
|
echo "Skipping docs step."
|
|
fi
|
|
|
|
if should_build "publish"; then
|
|
run_silent "Publishing release" "publish.log" \
|
|
"$SELF/release-build.sh" publish-release
|
|
else
|
|
echo "Skipping publish step."
|
|
fi
|