2015-06-24 21:47:03 +00:00
|
|
|
#!/bin/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.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# The script helps making a release.
|
2016-06-20 17:26:20 +00:00
|
|
|
# You need to specify release version and branch|tag name.
|
2015-06-24 21:47:03 +00:00
|
|
|
#
|
2016-06-20 17:26:20 +00:00
|
|
|
# Here are some helpful documents for the release.
|
2015-06-24 21:47:03 +00:00
|
|
|
# http://www.apache.org/dev/release.html
|
|
|
|
|
# http://www.apache.org/dev/release-publishing
|
|
|
|
|
# http://www.apache.org/dev/release-signing.html
|
|
|
|
|
|
2016-06-20 17:26:20 +00:00
|
|
|
BASEDIR="$(dirname "$0")"
|
|
|
|
|
. "${BASEDIR}/common_release.sh"
|
|
|
|
|
echo "${BASEDIR}/common_release.sh"
|
2015-06-24 21:47:03 +00:00
|
|
|
|
|
|
|
|
if [[ $# -ne 2 ]]; then
|
2016-06-20 17:26:20 +00:00
|
|
|
usage
|
2015-06-24 21:47:03 +00:00
|
|
|
fi
|
|
|
|
|
|
2017-01-19 07:28:30 +00:00
|
|
|
for var in GPG_PASSPHRASE; do
|
2016-12-13 10:34:39 +00:00
|
|
|
if [[ -z "${!var}" ]]; then
|
|
|
|
|
echo "You need ${var} variable set"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
done
|
2015-06-24 21:47:03 +00:00
|
|
|
|
2016-06-20 17:26:20 +00:00
|
|
|
RELEASE_VERSION="$1"
|
|
|
|
|
GIT_TAG="$2"
|
2017-01-13 02:39:42 +00:00
|
|
|
SCALA_VERSION="2.11"
|
2016-06-20 17:26:20 +00:00
|
|
|
|
|
|
|
|
function make_source_package() {
|
|
|
|
|
# create source package
|
|
|
|
|
cd ${WORKING_DIR}
|
|
|
|
|
cp -r "zeppelin" "zeppelin-${RELEASE_VERSION}"
|
|
|
|
|
${TAR} cvzf "zeppelin-${RELEASE_VERSION}.tgz" "zeppelin-${RELEASE_VERSION}"
|
|
|
|
|
|
|
|
|
|
echo "Signing the source package"
|
|
|
|
|
cd "${WORKING_DIR}"
|
|
|
|
|
echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 --armor \
|
|
|
|
|
--output "zeppelin-${RELEASE_VERSION}.tgz.asc" \
|
|
|
|
|
--detach-sig "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}.tgz"
|
|
|
|
|
echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 \
|
|
|
|
|
--print-md MD5 "zeppelin-${RELEASE_VERSION}.tgz" > \
|
|
|
|
|
"${WORKING_DIR}/zeppelin-${RELEASE_VERSION}.tgz.md5"
|
|
|
|
|
echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 \
|
|
|
|
|
--print-md SHA512 "zeppelin-${RELEASE_VERSION}.tgz" > \
|
|
|
|
|
"${WORKING_DIR}/zeppelin-${RELEASE_VERSION}.tgz.sha512"
|
|
|
|
|
}
|
2015-06-24 21:47:03 +00:00
|
|
|
|
|
|
|
|
function make_binary_release() {
|
2016-06-20 17:26:20 +00:00
|
|
|
BIN_RELEASE_NAME="$1"
|
|
|
|
|
BUILD_FLAGS="$2"
|
|
|
|
|
|
|
|
|
|
cp -r "${WORKING_DIR}/zeppelin" "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
|
|
|
|
|
cd "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
|
2017-01-13 02:39:42 +00:00
|
|
|
./dev/change_scala_version.sh "${SCALA_VERSION}"
|
2016-06-20 17:26:20 +00:00
|
|
|
echo "mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}"
|
|
|
|
|
mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}
|
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
|
echo "Build failed. ${BUILD_FLAGS}"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# re-create package with proper dir name with binary license
|
|
|
|
|
cd zeppelin-distribution/target/zeppelin-*
|
|
|
|
|
mv zeppelin-* "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
|
|
|
|
|
cat ../../src/bin_license/LICENSE >> "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}/LICENSE"
|
|
|
|
|
cat ../../src/bin_license/NOTICE >> "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}/NOTICE"
|
|
|
|
|
cp ../../src/bin_license/licenses/* "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}/licenses/"
|
|
|
|
|
${TAR} cvzf "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz" "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
|
|
|
|
|
|
|
|
|
|
# sign bin package
|
|
|
|
|
echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 --armor \
|
|
|
|
|
--output "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.asc" \
|
|
|
|
|
--detach-sig "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz"
|
|
|
|
|
echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 --print-md MD5 \
|
|
|
|
|
"zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz" > \
|
|
|
|
|
"zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.md5"
|
|
|
|
|
${SHASUM} -a 512 "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz" > \
|
|
|
|
|
"zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.sha512"
|
|
|
|
|
|
|
|
|
|
mv "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz" "${WORKING_DIR}/"
|
|
|
|
|
mv "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.asc" "${WORKING_DIR}/"
|
|
|
|
|
mv "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.md5" "${WORKING_DIR}/"
|
|
|
|
|
mv "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.sha512" "${WORKING_DIR}/"
|
|
|
|
|
|
|
|
|
|
# clean up build dir
|
|
|
|
|
rm -rf "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
|
2015-06-24 21:47:03 +00:00
|
|
|
}
|
|
|
|
|
|
2016-06-20 17:26:20 +00:00
|
|
|
git_clone
|
|
|
|
|
make_source_package
|
2017-04-07 10:44:26 +00:00
|
|
|
make_binary_release all "-Pspark-2.1 -Phadoop-2.6 -Pscala-${SCALA_VERSION}"
|
|
|
|
|
make_binary_release netinst "-Pspark-2.1 -Phadoop-2.6 -Pscala-${SCALA_VERSION} -pl zeppelin-interpreter,zeppelin-zengine,:zeppelin-display_${SCALA_VERSION},:zeppelin-spark-dependencies_${SCALA_VERSION},:zeppelin-spark_${SCALA_VERSION},zeppelin-web,zeppelin-server,zeppelin-distribution -am"
|
2015-06-24 21:47:03 +00:00
|
|
|
|
|
|
|
|
# remove non release files and dirs
|
2016-06-20 17:26:20 +00:00
|
|
|
rm -rf "${WORKING_DIR}/zeppelin"
|
|
|
|
|
rm -rf "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}"
|
2015-06-24 21:47:03 +00:00
|
|
|
echo "Release files are created under ${WORKING_DIR}"
|