return CheckCleanProperty
+def IsTaggingRequested(step):
+ val = step.getProperty("tag")
+ if val and re.match("^[0-9]+\.[0-9]+\.[0-9]+$", val):
+ return True
+ else:
+ return False
+
+def IsNoTaggingRequested(step):
+ return not IsTaggingRequested(step)
+
c['builders'] = []
doStepIf = IsCleanRequested(tuple[0])
))
+ factory.addStep(MasterShellCommand(
+ name = "maketag",
+ description = "Tagging Git repository",
+ command = [home_dir+'/maketag.sh', '-i', '-k', str(gpg_keyid or ''),
+ '-p', str(gpg_passfile or ''), '-v', WithProperties("%(tag:-)s")],
+ path = home_dir+'/source.git',
+ env = {'GNUPGHOME': gpg_home},
+ haltOnFailure = True,
+ doStepIf = IsTaggingRequested
+ ))
+
+ # switch to branch
+ factory.addStep(ShellCommand(
+ name = "switchbranch",
+ description = "Checking out Git branch",
+ command = ["git", "checkout", repo_branch],
+ haltOnFailure = True,
+ doStepIf = IsNoTaggingRequested
+ ))
+
# check out the source
factory.addStep(Git(
repourl = repo_url,
mode = 'incremental',
method = 'clean'))
+ # fetch tags
+ factory.addStep(ShellCommand(
+ name = "fetchtag",
+ description = "Fetching Git tags",
+ command = ["git", "fetch", "--tags", "--", repo_url],
+ haltOnFailure = True,
+ doStepIf = IsTaggingRequested
+ ))
+
+ # switch to tag
+ factory.addStep(ShellCommand(
+ name = "switchtag",
+ description = "Checking out Git tag",
+ command = ["git", "checkout", WithProperties("tags/v%(tag:-)s")],
+ haltOnFailure = True,
+ doStepIf = IsTaggingRequested
+ ))
+
factory.addStep(ShellCommand(
name = "rmtmp",
description = "Remove tmp folder",