From a71d20fa042bfac34b139545d2431a8ba6018b68 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Wed, 14 Mar 2012 13:09:40 -0300 Subject: [PATCH] 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. --- rel-eng/releasers.conf | 7 +++++++ releasers.conf.5.asciidoc | 3 +++ src/tito/builder.py | 5 +++++ src/tito/cli.py | 3 +++ 4 files changed, 18 insertions(+) diff --git a/rel-eng/releasers.conf b/rel-eng/releasers.conf index a1e4f0a..2a4a25e 100644 --- a/rel-eng/releasers.conf +++ b/rel-eng/releasers.conf @@ -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/ + diff --git a/releasers.conf.5.asciidoc b/releasers.conf.5.asciidoc index e9c9cef..9d19f50 100644 --- a/releasers.conf.5.asciidoc +++ b/releasers.conf.5.asciidoc @@ -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] diff --git a/src/tito/builder.py b/src/tito/builder.py index cda53ba..dcbe616 100644 --- a/src/tito/builder.py +++ b/src/tito/builder.py @@ -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.") diff --git a/src/tito/cli.py b/src/tito/cli.py index d7bfff6..39c57a6 100644 --- a/src/tito/cli.py +++ b/src/tito/cli.py @@ -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.")