From f13031384c967f45559721cbf0c49a87c2027a1c Mon Sep 17 00:00:00 2001 From: John Carr Date: Tue, 5 Nov 2013 21:52:28 +0000 Subject: [PATCH] Allow buildbot to set the channel (stable or nightlies) --- build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build b/build index ffa7ae7..2d743e2 100755 --- a/build +++ b/build @@ -195,21 +195,24 @@ class Repository(object): class S3Repository(Repository): + def __init__(self, channel="nightlies"): + self.channel = channel + def after_build(self): # We sync twice - this is to ensure that when we delete files we don't cause a window where apt is broken # Unfortunately we can't fix all races because apt-get update might have been run an hour before someone calls apt-get install - or indeed worse print "Uploading new stuff" for d in ("pool", "dists"): - subprocess.check_call(["s3cmd", "sync", os.path.join(self.root_dir, d) + "/", "s3://yaybu.com/nightlies/apt/%s/" % d]) + subprocess.check_call(["s3cmd", "sync", os.path.join(self.root_dir, d) + "/", "s3://yaybu.com/%s/apt/%s/" % (self.channel, d)]) print "Deleting old stuff" for d in ("pool", "dists"): - subprocess.check_call(["s3cmd", "sync", "--delete-removed", os.path.join(self.root_dir, d) + "/", "s3://yaybu.com/nightlies/apt/%s/" % d]) + subprocess.check_call(["s3cmd", "sync", "--delete-removed", os.path.join(self.root_dir, d) + "/", "s3://yaybu.com/%s/apt/%s/" % (self.channel, d)]) if __name__ == "__main__": import sys - r = S3Repository() + r = S3Repository(sys.argv[2]) r.apply() r.build(".", version=sys.argv[1])