X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=phase2%2Fmaster.cfg;h=f12e4797bca78a4937ba9a1131259495c2e0ec3f;hb=3294e6522ba4639de4591443e2ded312943fbb67;hp=ef7b81778b85572b3675a5a274c156f7348aa811;hpb=b71f4a13b2986dff0a6ed551ea4123e99a58df4a;p=buildbot.git diff --git a/phase2/master.cfg b/phase2/master.cfg index ef7b817..f12e479 100644 --- a/phase2/master.cfg +++ b/phase2/master.cfg @@ -25,6 +25,11 @@ c = BuildmasterConfig = {} # slave name and password must be configured on the slave. from buildbot.buildslave import BuildSlave +slave_port = 9990 + +if ini.has_option("general", "port"): + slave_port = ini.getint("general", "port") + c['slaves'] = [] for section in ini.sections(): @@ -40,7 +45,7 @@ for section in ini.sections(): # 'slavePortnum' defines the TCP port to listen on for connections from slaves. # This must match the value configured into the buildslaves (with their # --master option) -c['slavePortnum'] = 9990 +c['slavePortnum'] = slave_port # coalesce builds c['mergeRequests'] = True @@ -61,6 +66,20 @@ if ini.has_option("rsync", "source_url"): rsync_src_url = ini.get("rsync", "source_url") rsync_src_key = ini.get("rsync", "source_password") +gpg_keyid = None +gpg_comment = "Unattended build signature" +gpg_passfile = "/dev/null" + +if ini.has_option("gpg", "keyid"): + gpg_keyid = ini.get("gpg", "keyid") + +if ini.has_option("gpg", "comment"): + gpg_comment = ini.get("gpg", "comment") + +if ini.has_option("gpg", "passfile"): + gpg_passfile = ini.get("gpg", "passfile") + + # find arches arches = [ ] archnames = [ ] @@ -120,7 +139,9 @@ from buildbot.process.factory import BuildFactory from buildbot.steps.source import Git from buildbot.steps.shell import ShellCommand from buildbot.steps.shell import SetProperty +from buildbot.steps.transfer import FileUpload from buildbot.steps.transfer import FileDownload +from buildbot.steps.master import MasterShellCommand from buildbot.process.properties import WithProperties c['builders'] = [] @@ -170,13 +191,13 @@ 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/[Ll][Ee][Dd][Ee]-[Ss][Dd][Kk]-*.tar.bz2" %(ts[0], ts[1]), "sdk.tar.bz2"], + 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)) factory.addStep(ShellCommand( name = "unpacksdk", description = "Unpacking SDK archive", - command = ["tar", "--strip-components=1", "-C", "sdk/", "-vxjf", "sdk.tar.bz2"], + command = ["tar", "--strip-components=1", "-C", "sdk/", "-vxJf", "sdk.tar.xz"], haltOnFailure = True)) factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="sdk/key-build", mode=0600)) @@ -211,6 +232,49 @@ for arch in arches: workdir = "build/sdk", command = ["make", WithProperties("-j%(nproc:~4)s"), "V=s", "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_SIGNED_PACKAGES=y"])) + if gpg_keyid is not None: + factory.addStep(MasterShellCommand( + name = "signprepare", + description = "Preparing temporary signing directory", + command = ["mkdir", "-p", "%s/signing" %(home_dir)], + haltOnFailure = True + )) + + factory.addStep(ShellCommand( + name = "signpack", + description = "Packing files to sign", + workdir = "build/sdk", + command = "find bin/packages/%s/ -mindepth 2 -maxdepth 2 -type f -name Packages -print0 | xargs -0 tar -czf sign.tar.gz" %(arch[0]), + haltOnFailure = True + )) + + factory.addStep(FileUpload( + slavesrc = "sdk/sign.tar.gz", + masterdest = "%s/signing/%s.tar.gz" %(home_dir, arch[0]), + haltOnFailure = True + )) + + factory.addStep(MasterShellCommand( + name = "signfiles", + description = "Signing files", + command = ["%s/signall.sh" %(home_dir), "%s/signing/%s.tar.gz" %(home_dir, arch[0]), gpg_keyid, gpg_passfile, gpg_comment], + haltOnFailure = True + )) + + factory.addStep(FileDownload( + mastersrc = "%s/signing/%s.tar.gz" %(home_dir, arch[0]), + slavedest = "sdk/sign.tar.gz", + haltOnFailure = True + )) + + factory.addStep(ShellCommand( + name = "signunpack", + description = "Unpacking signed files", + workdir = "build/sdk", + command = ["tar", "-xzf", "sign.tar.gz"], + haltOnFailure = True + )) + factory.addStep(ShellCommand( name = "uploadprepare", description = "Preparing package directory", @@ -225,7 +289,7 @@ for arch in arches: name = "packageupload", description = "Uploading package files", workdir = "build/sdk", - command = ["rsync", "--delete", "--delay-updates", WithProperties("--partial-dir=.~tmp~%(slavename)s"), "-avz", "bin/packages/%s/" %(arch[0]), "%s/packages/%s/" %(rsync_bin_url, arch[0])], + command = ["rsync", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "bin/packages/%s/" %(arch[0]), "%s/packages/%s/" %(rsync_bin_url, arch[0])], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False @@ -261,7 +325,7 @@ for arch in arches: name = "logupload", description = "Uploading failure logs", workdir = "build/sdk", - command = ["rsync", "--delete", "--delay-updates", WithProperties("--partial-dir=.~tmp~%(slavename)s"), "-avz", "faillogs/", "%s/faillogs/%s/" %(rsync_bin_url, arch[0])], + command = ["rsync", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "faillogs/", "%s/faillogs/%s/" %(rsync_bin_url, arch[0])], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = False, logEnviron = False @@ -272,7 +336,7 @@ for arch in arches: name = "sourceupload", description = "Uploading source archives", workdir = "build/sdk", - command = ["rsync", "--delay-updates", WithProperties("--partial-dir=.~tmp~%(slavename)s"), "-avz", "dl/", "%s/" %(rsync_src_url)], + command = ["rsync", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-avz", "dl/", "%s/" %(rsync_src_url)], env={'RSYNC_PASSWORD': rsync_src_key}, haltOnFailure = False, logEnviron = False @@ -300,7 +364,7 @@ if ini.has_option("status", "bind"): # change any of these to True to enable; see the manual for more # options auth=auth.BasicAuth([(ini.get("status", "user"), ini.get("status", "password"))]), - gracefulShutdown = False, + gracefulShutdown = 'auth', forceBuild = 'auth', # use this to test your slave once it is set up forceAllBuilds = 'auth', pingBuilder = False,