2016-02-07 20:02:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-08-25 17:13:50 +00:00
|
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/release_lib.sh"
|
2016-02-07 20:02:44 +00:00
|
|
|
|
|
|
|
CONTROL=debian/control
|
|
|
|
CHLOG=debian/changelog
|
2016-06-26 04:34:48 +00:00
|
|
|
CHDATE=$(LC_ALL=C date -R | sed -e 's/,/\\,/g') # Replace comma to '\,'
|
2016-02-07 20:02:44 +00:00
|
|
|
|
2016-06-26 04:34:48 +00:00
|
|
|
# Build a package with configuration files for Yandex.Metrika.
|
2016-03-02 20:30:56 +00:00
|
|
|
BUILD_PACKAGE_FOR_METRIKA=$([ -f 'private/Server/metrika/config.xml' ] && echo 'yes')
|
|
|
|
|
2016-06-10 14:42:05 +00:00
|
|
|
while [[ $1 == --* ]]
|
|
|
|
do
|
|
|
|
# Don't sign packages, don't upload, don't create tags.
|
|
|
|
if [[ $1 == '--standalone' ]]
|
|
|
|
then
|
|
|
|
STANDALONE='yes'
|
|
|
|
DEBUILD_NOSIGN_OPTIONS="-us -uc"
|
|
|
|
shift
|
|
|
|
elif [[ $1 == '--test' ]]
|
|
|
|
then
|
|
|
|
STANDALONE='yes'
|
|
|
|
TEST='yes'
|
|
|
|
DEBUILD_NOSIGN_OPTIONS="-us -uc"
|
|
|
|
shift
|
2017-01-10 19:42:24 +00:00
|
|
|
elif [[ $1 == '--ignore-deps' ]]
|
|
|
|
then
|
|
|
|
DEBUILD_NODEPS_OPTIONS="-d"
|
|
|
|
shift
|
2017-02-01 20:49:32 +00:00
|
|
|
elif [[ $1 == '--version' ]]
|
|
|
|
then
|
|
|
|
gen_revision_author
|
|
|
|
git push
|
|
|
|
exit 0
|
2016-06-10 14:42:05 +00:00
|
|
|
else
|
|
|
|
echo "Unknown option $1"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
done
|
2016-05-28 00:52:18 +00:00
|
|
|
|
2016-06-10 14:42:05 +00:00
|
|
|
if [[ $TEST != 'yes' ]]
|
|
|
|
then
|
2017-03-16 15:35:50 +00:00
|
|
|
# now incrementing done in external release scripts via --version
|
|
|
|
get_revision_author
|
2016-06-10 14:42:05 +00:00
|
|
|
else
|
|
|
|
REVISION=99999
|
|
|
|
fi
|
|
|
|
|
2016-02-07 20:02:44 +00:00
|
|
|
echo -e "\nCurrent revision is $REVISION"
|
|
|
|
|
2017-04-10 17:43:30 +00:00
|
|
|
gen_changelog "$REVISION" "$CHDATE" "$AUTHOR" "$CHLOG"
|
2016-02-07 20:02:44 +00:00
|
|
|
|
2016-06-26 04:34:48 +00:00
|
|
|
# Build (only binary packages).
|
2017-04-10 17:43:30 +00:00
|
|
|
debuild -eDEB_BUILD_OPTIONS=parallel=`nproc || grep -c ^processor /proc/cpuinfo` -e DEB_CC -e DEB_CXX -e CMAKE_FLAGS_ADD -b ${DEBUILD_NOSIGN_OPTIONS} ${DEBUILD_NODEPS_OPTIONS}
|
2016-02-07 20:02:44 +00:00
|
|
|
|
2016-05-28 00:52:18 +00:00
|
|
|
if [[ $STANDALONE != 'yes' ]]
|
|
|
|
then
|
2017-04-10 17:43:30 +00:00
|
|
|
upload_debs "$REVISION"
|
2016-05-28 00:52:18 +00:00
|
|
|
fi
|