Add support for test build releases.

Adding "builder.test = 1" to a target in releasers.conf will allow you
to submit test builds out to a yum repository. This can be useful for
automated nightly builds. This is done as a builder arg rather than a
CLI argument to prevent anyone from accidentally doing a --test release
for something important. Instead it is a feature you configure once for
your targets.
This commit is contained in:
Devan Goodwin 2012-03-14 13:09:40 -03:00
parent 9f8d535eb4
commit a71d20fa04
4 changed files with 18 additions and 0 deletions

View file

@ -30,3 +30,10 @@ autobuild_tags = tag1 tag2
releaser = tito.release.FedoraGitReleaser
branches = master el5 el6 f14 f15 f16
[yum-f16-x86_64-nightly]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-16-x86_64
builder.test = 1
rsync = fedorapeople.org:/srv/repos/dgoodwin/tito-devel/fedora-16/x86_64/ fedorapeople.org:/srv/repos/dgoodwin/tito-devel/fedora-16/i386/

View file

@ -22,6 +22,8 @@ RELEASERS
Tito includes several releaser implementations that can be used in releasers.conf. Additionally you may define a lib_dir in your tito.props globalconfig section, and place your own custom implementation of a releaser there.
Specify "builder.test = 1" in your releasers.conf target to enable --test builds. (uses the latest git HEAD rather than the latest tagged package) This can be useful for automating the publishing of a nightly build, which you would not want to continually have to tag.
tito.release.YumRepoReleaser::
Releaser which will build your packages, rsync down an existing yum repository, place your packages in it, regenerate the yum repodata, and rsync the yum repository back up.
@ -67,6 +69,7 @@ EXAMPLE
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-6-x86_64
builder.test = 1
rsync = fedorapeople.org:/srv/repos/dgoodwin/tito/epel-6/x86_64/
[cvs]

View file

@ -82,6 +82,11 @@ class Builder(object):
self.rpmbuild_options = self._get_optional_arg(kwargs,
'rpmbuild_options', None)
# Allow a builder arg to override the test setting passed in, used by
# releasers in their config sections.
if 'test' in args:
self.test = True
if 'options' in kwargs:
print("WARNING: 'options' no longer a supported builder "
"constructor argument.")

View file

@ -450,6 +450,9 @@ class ReleaseModule(BaseCliModule):
self.parser.add_option("--all", action="store_true",
help="Run all release targets configured.")
self.parser.add_option("--test", dest="test", action="store_true",
help="use current branch HEAD instead of latest package tag")
self.parser.add_option("--all-starting-with", dest="all_starting_with",
help="Run all release targets starting with the given string.")