use send-announcements-to metadata for deliverables

Pull send-announcements-to out of the deliverable file and put it into
the commit message for the new tag. Then when generating the
announcement, look for the metadata value and use it if found.

Change-Id: I8fac9f33973df07f6d716fab09fe51381f07b504
Depends-On: I41f3f4874464b37ff95ec1e41a0b6993b62dcf1d
This commit is contained in:
Doug Hellmann 2015-12-29 17:57:59 +00:00
parent 712d9082c6
commit 02d34c2d21
5 changed files with 28 additions and 9 deletions

View File

@ -94,6 +94,13 @@ function get_tag_meta {
# The series name is part of the commit message left by release.sh. # The series name is part of the commit message left by release.sh.
SERIES=$(get_tag_meta series) SERIES=$(get_tag_meta series)
# The recipient for announcements is part of the commit message left
# by release.sh.
ANNOUNCE=$(get_tag_meta announce)
if [[ ! -z "$ANNOUNCE" ]]; then
email_to="--email-to $ANNOUNCE"
fi
# Figure out if that series is a stable branch or not. # Figure out if that series is a stable branch or not.
if git branch -a | grep -q origin/stable/$SERIES; then if git branch -a | grep -q origin/stable/$SERIES; then
stable="--stable" stable="--stable"
@ -111,6 +118,7 @@ relnotes_file="$RELNOTESDIR/$SHORTNAME-$VERSION"
release-notes \ release-notes \
--email \ --email \
$email_to \
$email_tags \ $email_tags \
--series $SERIES \ --series $SERIES \
$stable \ $stable \

View File

@ -24,9 +24,9 @@ TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $TOOLSDIR/functions source $TOOLSDIR/functions
function usage { function usage {
echo "Usage: release.sh [-a] repository series version SHA" echo "Usage: release.sh [-a] repository series version SHA announce"
echo echo
echo "Example: release.sh openstack/oslo.rootwrap mitaka 3.0.3 gerrit/master" echo "Example: release.sh openstack/oslo.rootwrap mitaka 3.0.3 gerrit/master openstack-dev@lists.openstack.org"
} }
announce=false announce=false
@ -40,7 +40,7 @@ while getopts "a" opt "$@"; do
done done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [ $# -lt 4 ]; then if [ $# -lt 5 ]; then
usage usage
exit 2 exit 2
fi fi
@ -49,6 +49,7 @@ REPO=$1
SERIES=$2 SERIES=$2
VERSION=$3 VERSION=$3
SHA=$4 SHA=$4
ANNOUNCE=$5
SHORTNAME=`basename $REPO` SHORTNAME=`basename $REPO`
@ -87,6 +88,7 @@ else
meta:version: $VERSION meta:version: $VERSION
meta:series: $SERIES meta:series: $SERIES
meta:release-type: $RELEASETYPE meta:release-type: $RELEASETYPE
meta:announce: $ANNOUNCE
" "
echo "Tag message is '$TAGMSG'" echo "Tag message is '$TAGMSG'"
git tag -m "$TAGMSG" -s "$VERSION" $TARGETSHA git tag -m "$TAGMSG" -s "$VERSION" $TARGETSHA

View File

@ -57,8 +57,9 @@ if [[ -z "$VIRTUAL_ENV" ]]; then
fi fi
list-deliverable-changes -r $RELEASES_REPO $DELIVERABLES \ list-deliverable-changes -r $RELEASES_REPO $DELIVERABLES \
| while read deliverable series version repo hash; do | while read deliverable series version repo hash announce_to; do
$TOOLSDIR/release.sh $announce $repo $series $version $hash title "$repo $series $version $hash $announce_to"
$TOOLSDIR/release.sh $announce $repo $series $version $hash $announce_to
done done
exit 0 exit 0

View File

@ -40,9 +40,8 @@ def main():
args.releases_repo, args.releases_repo,
args.deliverable_file, args.deliverable_file,
) )
for deliverable_name, series_name, version, repo, hash in results: for r in results:
print('%s %s %s %s %s' % print(' '.join(r))
(deliverable_name, series_name, version, repo, hash))
return 0 return 0

View File

@ -52,6 +52,14 @@ def get_modified_deliverable_file_content(reporoot, filenames):
with open(filename, 'r') as f: with open(filename, 'r') as f:
deliverable_data = yaml.load(f.read()) deliverable_data = yaml.load(f.read())
# Determine where to send email announcements of
# releases. Default to the development list, to cut down on
# excessive emails to the announcement list.
send_announcements_to = deliverable_data.get(
'send-announcements-to',
'openstack-dev@lists.openstack.org',
)
# The series name is part of the filename, rather than the file # The series name is part of the filename, rather than the file
# body. That causes release.sh to be called with series="_independent" # body. That causes release.sh to be called with series="_independent"
# for release:independent projects, and release.sh to use master branch # for release:independent projects, and release.sh to use master branch
@ -68,4 +76,5 @@ def get_modified_deliverable_file_content(reporoot, filenames):
this_version = all_versions[version] this_version = all_versions[version]
for project in this_version['projects']: for project in this_version['projects']:
yield (deliverable_name, series_name, version, yield (deliverable_name, series_name, version,
project['repo'], project['hash']) project['repo'], project['hash'],
send_announcements_to)