ClickHouse/release

106 lines
2.8 KiB
Plaintext
Raw Normal View History

2019-04-16 14:12:02 +00:00
#!/usr/bin/env bash
2016-02-07 20:02:44 +00:00
2018-08-08 05:19:54 +00:00
# If you have "no space left" error, you can change the location of temporary files with BUILDPLACE environment variable.
2018-07-17 11:15:14 +00:00
# Version increment:
# Default release: 18.1.2 -> 18.2.0:
# ./release --version
# or
# ./release --version minor
# Bugfix release (only with small patches to previous release): 18.1.2 -> 18.1.3:
# ./release --version patch
# Do this once per year: 18.1.2 -> 19.0.0:
# ./release --version major
set -e
# Avoid dependency on locale
LC_ALL=C
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd $CUR_DIR
source "./utils/release/release_lib.sh"
2016-02-07 20:02:44 +00:00
DEBUILD_NOSIGN_OPTIONS="-us -uc"
DEBUILD_NODEPS_OPTIONS="-d"
2018-07-17 11:15:14 +00:00
if [ -z "$VERSION_STRING" ] ; then
get_revision_author
fi
2016-06-10 14:42:05 +00:00
while [[ $1 == --* ]]
do
if [[ $1 == '--test' ]]; then
TEST='yes'
VERSION_POSTFIX+=+test
shift
elif [[ $1 == '--check-build-dependencies' ]]; then
DEBUILD_NODEPS_OPTIONS=""
shift
elif [[ $1 == '--version' ]]; then
2018-07-17 11:15:14 +00:00
gen_revision_author $2
exit 0
elif [[ $1 == '--rpm' ]]; then
MAKE_RPM=1
shift
elif [[ $1 == '--tgz' ]]; then
MAKE_TGZ=1
shift
else
echo "Unknown option $1"
exit 2
fi
2016-06-10 14:42:05 +00:00
done
# Build options
if [ -n "$SANITIZER" ]
2016-06-10 14:42:05 +00:00
then
if [[ "$SANITIZER" == "address" ]]; then VERSION_POSTFIX+="+asan"
elif [[ "$SANITIZER" == "thread" ]]; then VERSION_POSTFIX+="+tsan"
elif [[ "$SANITIZER" == "memory" ]]; then VERSION_POSTFIX+="+msan"
elif [[ "$SANITIZER" == "undefined" ]]; then VERSION_POSTFIX+="+ubsan"
2019-09-22 10:34:09 +00:00
elif [[ "$SANITIZER" == "libfuzzer" ]]; then
VERSION_POSTFIX+="+libfuzzer"
MALLOC_OPTS="-DENABLE_TCMALLOC=0 -DENABLE_JEMALLOC=0"
else
echo "Unknown value of SANITIZER variable: $SANITIZER"
exit 3
fi
2020-09-24 08:35:16 +00:00
export DEB_CC=${DEB_CC=clang-10}
export DEB_CXX=${DEB_CXX=clang++-10}
EXTRAPACKAGES="$EXTRAPACKAGES clang-10 lld-10"
elif [[ $BUILD_TYPE == 'valgrind' ]]; then
2018-08-08 03:45:37 +00:00
MALLOC_OPTS="-DENABLE_TCMALLOC=0 -DENABLE_JEMALLOC=0"
VERSION_POSTFIX+="+valgrind"
elif [[ $BUILD_TYPE == 'debug' ]]; then
CMAKE_BUILD_TYPE=Debug
VERSION_POSTFIX+="+debug"
fi
CMAKE_FLAGS=" $MALLOC_OPTS -DSANITIZE=$SANITIZER -DENABLE_CHECK_HEAVY_BUILDS=1 $CMAKE_FLAGS"
2018-05-17 17:55:07 +00:00
[[ -n "$CMAKE_BUILD_TYPE" ]] && CMAKE_FLAGS=" -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE $CMAKE_FLAGS"
2018-05-16 00:34:56 +00:00
2017-12-28 13:27:49 +00:00
export CMAKE_FLAGS
2018-01-19 21:33:48 +00:00
export EXTRAPACKAGES
2018-07-17 11:15:14 +00:00
VERSION_STRING+=$VERSION_POSTFIX
echo -e "\nCurrent version is $VERSION_STRING"
2016-02-07 20:02:44 +00:00
if [ -z "$NO_BUILD" ] ; then
2019-06-27 15:36:31 +00:00
gen_changelog "$VERSION_STRING" "" "$AUTHOR" ""
2021-04-24 23:11:31 +00:00
# Build (only binary packages).
debuild --preserve-env -e PATH \
-e DEB_CC=$DEB_CC -e DEB_CXX=$DEB_CXX -e CMAKE_FLAGS="$CMAKE_FLAGS" \
-b ${DEBUILD_NOSIGN_OPTIONS} ${DEBUILD_NODEPS_OPTIONS}
fi
if [ -n "$MAKE_RPM" ]; then
make_rpm
fi
2018-01-19 21:33:48 +00:00
if [ -n "$MAKE_TGZ" ]; then
make_tgz
2017-12-28 13:27:49 +00:00
fi