phase2: implement dl/ uploading
authorJo-Philipp Wich <jo@mein.io>
Mon, 13 Jun 2016 11:18:51 +0000 (13:18 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 13 Jun 2016 11:18:51 +0000 (13:18 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
phase2/config.ini.example
phase2/master.cfg

index 1aada0f366ba4c9e76a4479310f689dfdcf3cf9d..f21f0d3791249597729b66f8ff10fcfbc210a0ab 100644 (file)
@@ -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
index e61fce55b5dd6d0f5f2ea38a1b15fbb91e05d995..873757a3ca1a99fe08374c471c882db0379675bf 100644 (file)
@@ -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))