From 32bf5adcb47e8d889a3544642b78fe870b4a612d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 13 Jun 2016 13:18:51 +0200 Subject: [PATCH] phase2: implement dl/ uploading Signed-off-by: Jo-Philipp Wich --- phase2/config.ini.example | 6 ++++-- phase2/master.cfg | 38 ++++++++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/phase2/config.ini.example b/phase2/config.ini.example index 1aada0f..f21f0d3 100644 --- a/phase2/config.ini.example +++ b/phase2/config.ini.example @@ -13,8 +13,10 @@ password = example url = https://git.lede-project.org/source.git [rsync] -url = user@example.org::upload -password = example +binary_url = user@example.org::upload-packages +binary_password = example +source_url = user@example.org::upload-sources +source_password = example2 [slave 1] name = slave-example-1 diff --git a/phase2/master.cfg b/phase2/master.cfg index e61fce5..873757a 100644 --- a/phase2/master.cfg +++ b/phase2/master.cfg @@ -51,8 +51,15 @@ home_dir = os.path.abspath(ini.get("general", "homedir")) repo_url = ini.get("repo", "url") -rsync_url = ini.get("rsync", "url") -rsync_key = ini.get("rsync", "password") +rsync_bin_url = ini.get("rsync", "binary_url") +rsync_bin_key = ini.get("rsync", "binary_password") + +rsync_src_url = None +rsync_src_key = None + +if ini.has_option("rsync", "source_url"): + rsync_src_url = ini.get("rsync", "source_url") + rsync_src_key = ini.get("rsync", "source_password") # find arches arches = [ ] @@ -208,8 +215,8 @@ for arch in arches: name = "uploadprepare", description = "Preparing package directory", workdir = "build/sdk", - command = ["rsync", "-av", "--include", "/%s/" %(arch[0]), "--exclude", "/*", "--exclude", "/%s/*" %(arch[0]), "bin/packages/", "%s/packages/" %(rsync_url)], - env={'RSYNC_PASSWORD': rsync_key}, + command = ["rsync", "-av", "--include", "/%s/" %(arch[0]), "--exclude", "/*", "--exclude", "/%s/*" %(arch[0]), "bin/packages/", "%s/packages/" %(rsync_bin_url)], + env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False )) @@ -218,8 +225,8 @@ for arch in arches: name = "packageupload", description = "Uploading package files", workdir = "build/sdk", - command = ["rsync", "--delete", "--delay-updates", "-avz", "bin/packages/%s/" %(arch[0]), "%s/packages/%s/" %(rsync_url, arch[0])], - env={'RSYNC_PASSWORD': rsync_key}, + command = ["rsync", "--delete", "--delay-updates", "-avz", "bin/packages/%s/" %(arch[0]), "%s/packages/%s/" %(rsync_bin_url, arch[0])], + env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False )) @@ -228,8 +235,8 @@ for arch in arches: name = "logprepare", description = "Preparing log directory", workdir = "build/sdk", - command = ["rsync", "-av", "--include", "/%s/" %(arch[0]), "--exclude", "/*", "--exclude", "/%s/*" %(arch[0]), "bin/packages/", "%s/faillogs/" %(rsync_url)], - env={'RSYNC_PASSWORD': rsync_key}, + command = ["rsync", "-av", "--include", "/%s/" %(arch[0]), "--exclude", "/*", "--exclude", "/%s/*" %(arch[0]), "bin/packages/", "%s/faillogs/" %(rsync_bin_url)], + env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False )) @@ -254,12 +261,23 @@ for arch in arches: name = "logupload", description = "Uploading failure logs", workdir = "build/sdk", - command = ["rsync", "--delete", "--delay-updates", "-avz", "faillogs/", "%s/faillogs/%s/" %(rsync_url, arch[0])], - env={'RSYNC_PASSWORD': rsync_key}, + command = ["rsync", "--delete", "--delay-updates", "-avz", "faillogs/", "%s/faillogs/%s/" %(rsync_bin_url, arch[0])], + env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = False, logEnviron = False )) + if rsync_src_url is not None: + factory.addStep(ShellCommand( + name = "sourceupload", + description = "Uploading source archives", + workdir = "build/sdk", + command = ["rsync", "--delay-updates", "-avz", "dl/", "%s/" %(rsync_src_url)], + env={'RSYNC_PASSWORD': rsync_src_key}, + haltOnFailure = False, + logEnviron = False + )) + from buildbot.config import BuilderConfig c['builders'].append(BuilderConfig(name=arch[0], slavenames=slaveNames, factory=factory)) -- 2.30.2