fix repository name detection

When we run in the gate, the workspace directory is named something like
python-keystoneclient-announce-release rather than
python-keystoneclient. Use the git URL to find the correct short name of
the repository.

Change-Id: Ica3408e6c5fe5f55436b27a69ff13cb0d40f68c6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2016-02-05 12:40:53 -05:00
parent 63d2c718df
commit 6b03962882
1 changed files with 7 additions and 2 deletions

View File

@ -31,7 +31,12 @@ source $TOOLSDIR/functions
REPODIR=$1
VERSION=$2
SHORTNAME=`basename $REPODIR`
# The repository directory may be named something other than what the
# repository is, if we're running under CI or someone has checked it
# out locally to an alternate name. Use the git remote URL as a source
# of better information for the real repository name.
SHORTNAME=$(basename $(cd $REPODIR && git config --get remote.origin.url))
# Assign a default "from" email address if one is not specified by the
# user's environment.
@ -132,7 +137,7 @@ echo $relnotes_file
echo
echo "Sending release announcement"
send-mail $relnotes_file || \
send-mail -v $relnotes_file || \
echo "Sending failed, see $relnotes_file for message body"
exit 0