Merge pull request #296 from adivinho/PG-430-Update-rpm-changelog-automatically

PG-430 update rpm changelog automatically
pull/303/head
Vadim Yalovets 2022-08-29 10:33:09 +03:00 committed by GitHub
commit 16536ae07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -92,6 +92,30 @@ add_percona_yum_repo(){
return
}
set_changelog(){
if [ -z $1 ]
then
echo "No spec file is provided"
return
else
start_line=0
while read -r line; do
(( start_line++ ))
if [ "$line" = "%changelog" ]
then
(( start_line++ ))
echo "$start_line"
current_date=$(date +"%a %b %d %Y")
sed -i "$start_line,$ d" $1
echo "* $current_date Percona Build/Release Team <eng-build@percona.com> - ${VERSION}-${RPM_RELEASE}" >> $1
echo "- Release ${VERSION}-${RPM_RELEASE}" >> $1
echo >> $1
return
fi
done <$1
fi
}
get_sources(){
cd "${WORKDIR}"
if [ "${SOURCE}" = 0 ]
@ -137,6 +161,8 @@ get_sources(){
sed -i "s:@@RPM_RELEASE@@:${RPM_RELEASE}:g" rpm/pg-stat-monitor.spec
sed -i "s:@@VERSION@@:${VERSION}:g" rpm/pg-stat-monitor.spec
set_changelog rpm/pg-stat-monitor.spec
cd ${WORKDIR}
#
source pg-stat-monitor.properties