From 14d372de9fcedf59e17f5ac864d16919468cbab6 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 19 Nov 2017 10:40:50 +0100 Subject: [PATCH] Add a special "branch" releaser If used, tito will use the name of our current GIT branch as release target if it's valid --- fwsreleasers/main.py | 10 +++++++++- releasers.conf | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/fwsreleasers/main.py b/fwsreleasers/main.py index b2cd729..4a2fb64 100644 --- a/fwsreleasers/main.py +++ b/fwsreleasers/main.py @@ -24,7 +24,15 @@ class RsyncSRPMSReleaser(RsyncReleaser): target=None, releaser_config=None, no_cleanup=False, test=False, auto_accept=False, prefix="temp_dir=", **kwargs): - RsyncReleaser.__init__(self, name, tag, build_dir, config, + if target == 'branch': + target = run_command('git symbolic-ref --short HEAD') + if target in [ 'el5', 'el6', 'el7', 'sme9', 'sme10' ]: + # Call ourselve with the new target + self.__init__(name, tag, build_dir, config, + user_config, target, releaser_config, no_cleanup, test, + auto_accept, **kwargs) + else: + RsyncReleaser.__init__(self, name, tag, build_dir, config, user_config, target, releaser_config, no_cleanup, test, auto_accept, **kwargs) diff --git a/releasers.conf b/releasers.conf index 41b1e20..f61b375 100644 --- a/releasers.conf +++ b/releasers.conf @@ -12,3 +12,8 @@ rsync = build.firewall-services.com:/var/lib/build/uploads/el6 releaser = fwsreleasers.RsyncSRPMSReleaser srpm_disttag = .fws rsync = build.firewall-services.com:/var/lib/build/uploads/el7 + +[branch] +releaser = fwsreleasers.RsyncSRPMSReleaser +srpm_disttag = .fws +rsync = build.firewall-services.com:/var/lib/build/uploads/branch