def IsNoTaggingRequested(step):
return not IsTaggingRequested(step)
+def IsNoMasterBuild(step):
+ return repo_branch != "master"
+
+def GetBaseVersion(props):
+ if re.match("^[^-]+-[0-9]+\.[0-9]+$", repo_branch):
+ return repo_branch.split('-')[1]
+ else:
+ return "master"
+
+def GetVersionPrefix(props):
+ basever = GetBaseVersion(props)
+ if props.hasProperty("tag") and re.match("^[0-9]+\.[0-9]+\.[0-9]+$", props["tag"]):
+ return "%s/" % props["tag"]
+ elif basever != "master":
+ return "%s-HEAD/" % basever
+ else:
+ return ""
+
c['builders'] = []
# upload
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_bin_url)],
+ name = "dirprepare",
+ description = "Preparing upload directory structure",
+ command = ["mkdir", "-p", WithProperties("tmp/upload/%%(prefix)stargets/%s/%s" %(ts[0], ts[1]), prefix=GetVersionPrefix)],
+ haltOnFailure = True
+ ))
+
+ factory.addStep(ShellCommand(
+ name = "linkprepare",
+ description = "Preparing repository symlink",
+ command = ["ln", "-s", "-f", WithProperties("../packages-%(basever)s", basever=GetBaseVersion), WithProperties("tmp/upload/%(prefix)spackages", prefix=GetVersionPrefix)],
+ doStepIf = IsNoMasterBuild,
+ haltOnFailure = True
+ ))
+
+ factory.addStep(ShellCommand(
+ name = "dirupload",
+ description = "Uploading directory structure",
+ command = ["rsync", "-avz", "tmp/upload/", "%s/" %(rsync_bin_url)],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = True,
logEnviron = False
factory.addStep(ShellCommand(
name = "targetupload",
description = "Uploading target files",
- command=["rsync", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", WithProperties("bin/targets/%s/%s%%(libc)s/" %(ts[0], ts[1])), "%s/targets/%s/%s/" %(rsync_bin_url, ts[0], ts[1])],
+ command=["rsync", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]),
+ "-avz", WithProperties("bin/targets/%s/%s%%(libc)s/" %(ts[0], ts[1])),
+ WithProperties("%s/%%(prefix)stargets/%s/%s/" %(rsync_bin_url, ts[0], ts[1]), prefix=GetVersionPrefix)],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = True,
logEnviron = False