-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathversion-bump.sh
executable file
·39 lines (31 loc) · 1.02 KB
/
version-bump.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# David Kedves <[email protected]>
if [ ! -d debian ]; then
echo "Please execute this script inside the project directory."
exit 1
fi
if [ "${PUBLISHING_REPO}" == "TESTING" ]; then
VERSION_SUFFIX='testing'
RELEASE_LOG_LINE='Testing release'
else
VERSION_SUFFIX='release1'
RELEASE_LOG_LINE='Release'
fi
# remove old source packages
# rm -fv ../s9s-tools*
export LC_ALL=C
export LC_DATE=C
DEBEMAIL="[email protected]"
DEBFULLNAME="Severalnines"
export EMAIL=${DEBEMAIL}
export DEBFULLNAME=${DEBFULLNAME}
VERSION="1.9.`date +%Y%m%d%H`"
# RPM needs the date/time in a very specific format
RPMDATE=`date +"%a %b %_d %Y"`
echo "VERSION:"
echo "${VERSION}" | tee version.txt
# debian changelog update
debchange --newversion "${VERSION}-${VERSION_SUFFIX}" "${RELEASE_LOG_LINE} ${VERSION}."
# rpm project version update
sed "s/%changelog/%changelog\n* ${RPMDATE} ${DEBFULLNAME} <${DEBEMAIL}> ${VERSION}\n- ${RELEASE_LOG_LINE} ${VERSION}./" -i project.spec
#dpkg-buildpackage -rfakeroot -S --no-sign