From 532ff1e3decf036d576abfceaf6656dedeabd625 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 13 Jun 2016 13:18:44 +0200 Subject: [PATCH] phase1: implement dl/ uploading Signed-off-by: Jo-Philipp Wich --- phase1/config.ini.example | 6 ++++-- phase1/master.cfg | 37 +++++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/phase1/config.ini.example b/phase1/config.ini.example index de77ecc..fdde485 100644 --- a/phase1/config.ini.example +++ b/phase1/config.ini.example @@ -20,8 +20,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-binary +binary_password = example +source_url = user@example.org::upload-sources +source_password = example2 [slave 1] name = example-slave-1 diff --git a/phase1/master.cfg b/phase1/master.cfg index 69f3b78..c0c105d 100644 --- a/phase1/master.cfg +++ b/phase1/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 targets targets = [ ] @@ -422,8 +429,8 @@ EOT''' %(ts[0], ts[0], ts[1]) )) factory.addStep(ShellCommand( name = "uploadprepare", description = "Preparing target directory", - command=["rsync", "-av", "--include", "/%s/" %(ts[0]), "--include", "/%s/%s/" %(ts[0], ts[1]), "--exclude", "/*", "--exclude", "/*/*", "--exclude", "/%s/%s/*" %(ts[0], ts[1]), "bin/targets/", "%s/targets/" %(rsync_url)], - env={'RSYNC_PASSWORD': rsync_key}, + command=["rsync", "-av", "--include", "/%s/" %(ts[0]), "--include", "/%s/%s/" %(ts[0], ts[1]), "--exclude", "/*", "--exclude", "/*/*", "--exclude", "/%s/%s/*" %(ts[0], ts[1]), "bin/targets/", "%s/targets/" %(rsync_bin_url)], + env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False )) @@ -431,18 +438,28 @@ EOT''' %(ts[0], ts[0], ts[1]) )) factory.addStep(ShellCommand( name = "targetupload", description = "Uploading target files", - command=["rsync", "--delete", "--delay-updates", "-avz", "bin/targets/%s/%s/" %(ts[0], ts[1]), "%s/targets/%s/%s/" %(rsync_url, ts[0], ts[1])], - env={'RSYNC_PASSWORD': rsync_key}, + command=["rsync", "--delete", "--delay-updates", "-avz", "bin/targets/%s/%s/" %(ts[0], ts[1]), "%s/targets/%s/%s/" %(rsync_bin_url, ts[0], ts[1])], + env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False )) + if rsync_src_url is not None: + factory.addStep(ShellCommand( + name = "sourceupload", + description = "Uploading source archives", + command=["rsync", "--delay-updates", "-avz", "dl/", "%s/" %(rsync_src_url)], + env={'RSYNC_PASSWORD': rsync_src_key}, + haltOnFailure = True, + logEnviron = False + )) + if False: factory.addStep(ShellCommand( name = "packageupload", description = "Uploading package files", - command=["rsync", "--delete", "--delay-updates", "-avz", "bin/packages/", "%s/packages/" %(rsync_url)], - env={'RSYNC_PASSWORD': rsync_key}, + command=["rsync", "--delete", "--delay-updates", "-avz", "bin/packages/", "%s/packages/" %(rsync_bin_url)], + env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = False, logEnviron = False )) @@ -452,8 +469,8 @@ EOT''' %(ts[0], ts[0], ts[1]) )) factory.addStep(ShellCommand( name = "upload", description = "Uploading logs", - command=["rsync", "--delete", "--delay-updates", "-avz", "logs/", "%s/logs/%s/%s/" %(rsync_url, ts[0], ts[1])], - env={'RSYNC_PASSWORD': rsync_key}, + command=["rsync", "--delete", "--delay-updates", "-avz", "logs/", "%s/logs/%s/%s/" %(rsync_bin_url, ts[0], ts[1])], + env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = False, alwaysRun = True, logEnviron = False -- 2.30.2