phase2: make SDK URL configurable
authorJo-Philipp Wich <jo@mein.io>
Mon, 14 Nov 2016 13:18:57 +0000 (14:18 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 14 Nov 2016 13:18:57 +0000 (14:18 +0100)
Also allow to specify the SDK file name pattern and make the decompression
format agnostic.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
phase2/config.ini.example
phase2/master.cfg

index e48f66e4e6a0f0dbfa6e5b7fd7b9a321270a0772..0ad799b45f7e244259d509c8c82ddba1f6e5b008 100644 (file)
@@ -15,6 +15,9 @@ binary_url = user@example.org::upload-packages
 binary_password = example
 source_url = user@example.org::upload-sources
 source_password = example2
+sdk_url = user@example.org::download-binary
+sdk_password = example3
+sdk_pattern = lede-sdk-*.tar.xz
 
 [gpg]
 keyid = 626471F1
index ab423834d5ab70518881c7dd2a08cb3b2dd32a30..08c77c1f3aebd30f5630c9d7f08cfd05f71cec1e 100644 (file)
@@ -64,6 +64,17 @@ if ini.has_option("rsync", "source_url"):
        rsync_src_url = ini.get("rsync", "source_url")
        rsync_src_key = ini.get("rsync", "source_password")
 
+rsync_sdk_url = None
+rsync_sdk_key = None
+rsync_sdk_pat = "lede-sdk-*.tar.xz"
+
+if ini.has_option("rsync", "sdk_url"):
+       rsync_sdk_url = ini.get("rsync", "sdk_url")
+       rsync_sdk_key = ini.get("rsync", "sdk_password")
+
+if ini.has_option("rsync", "sdk_pattern"):
+       rsync_sdk_pat = ini.get("rsync", "sdk_pattern")
+
 gpg_keyid = None
 gpg_comment = "Unattended build signature"
 gpg_passfile = "/dev/null"
@@ -189,13 +200,15 @@ for arch in arches:
        factory.addStep(ShellCommand(
                name = "downloadsdk",
                description = "Downloading SDK archive",
-               command = ["rsync", "-va", "downloads.lede-project.org::downloads/snapshots/targets/%s/%s/lede-sdk-*.tar.xz" %(ts[0], ts[1]), "sdk.tar.xz"],
-               haltOnFailure = True))
+               command = ["rsync", "-va", "%s/%s/%s/%s" %(rsync_sdk_url, ts[0], ts[1], rsync_sdk_pat), "sdk.archive"],
+               env={'RSYNC_PASSWORD': rsync_sdk_key},
+               haltOnFailure = True,
+               logEnviron = False))
 
        factory.addStep(ShellCommand(
                name = "unpacksdk",
                description = "Unpacking SDK archive",
-               command = ["tar", "--strip-components=1", "-C", "sdk/", "-vxJf", "sdk.tar.xz"],
+               command = ["tar", "--strip-components=1", "-C", "sdk/", "-vxf", "sdk.archive"],
                haltOnFailure = True))
 
        factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="sdk/key-build", mode=0600))