support tarball names that do not match the repository name

Change-Id: I1bde36fe8272edb0d5b3bf89875395dccc2a8557
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2016-02-25 10:55:13 -05:00
parent d67a29eb4b
commit 2932c2b000
3 changed files with 19 additions and 4 deletions

View File

@ -219,6 +219,10 @@ Each `project` entry is a mapping with keys:
``hash``
The SHA1 hash for the commit to receive the version tag.
``tarball-base``
An optional name for the base of the tarball created by the
release. If no value is provided, it defaults to the repo base name.
Examples
========

View File

@ -5,20 +5,25 @@ releases:
- version: 0.0.1.0a1
projects:
- repo: openstack/release-test
tarball-base: openstack-release-test
hash: b87220eb8ba76c14d93362ca3d9ccfed1e2be343
- version: 0.0.1.0b3
projects:
- repo: openstack/release-test
tarball-base: openstack-release-test
hash: 186019bd7f725bf52c6f3aae8949b0daf42aa6d9
- version: 0.0.1.0rc1
projects:
- repo: openstack/release-test
tarball-base: openstack-release-test
hash: 186019bd7f725bf52c6f3aae8949b0daf42aa6d9
- version: 0.0.1.0rc2
projects:
- repo: openstack/release-test
tarball-base: openstack-release-test
hash: 9f48cae13a7388a6f6d1361634d320d73baef0d3
- version: 0.0.1
projects:
- repo: openstack/release-test
tarball-base: openstack-release-test
hash: 9f48cae13a7388a6f6d1361634d320d73baef0d3

View File

@ -133,11 +133,17 @@ class DeliverableDirectiveBase(rst.Directive):
}
@staticmethod
def _tarball_link(version, repo):
return '`{v} <{s}/{n}/{n}-{v}.tar.gz>`__'.format(
def _tarball_link(version, project):
repo_base = project['repo'].rsplit('/')[-1]
if 'tarball-base' in project:
base = project['tarball-base']
else:
base = repo_base
return '`{v} <{s}/{r}/{n}-{v}.tar.gz>`__'.format(
s='https://tarballs.openstack.org',
v=version,
n=repo.rsplit('/')[-1],
r=repo_base,
n=base,
)
def _add_deliverables(self, type_tag, deliverables, series, app, result):
@ -206,7 +212,7 @@ class DeliverableDirectiveBase(rst.Directive):
_list_table(
_add,
['Version', 'Repo', 'Git Commit'],
((self._tarball_link(r['version'], p['repo']),
((self._tarball_link(r['version'], p),
p['repo'], p['hash'])
for r in reversed(deliverable_info.get('releases', []))
for p in r.get('projects', [])),