phase1: do not perform shallow fetches
[buildbot.git] / phase1 / master.cfg
index a8d6737682c9a7839dddd0836b32fd7226fa8f05..04879e800f6ebfa17470714bc679dc1ccfc178b7 100644 (file)
@@ -246,6 +246,12 @@ def GetCwd(props):
        else:
                return "/"
 
+def GetNextBuild(builder, requests):
+       for r in requests:
+               if r.properties and r.properties.hasProperty("tag"):
+                       return r
+       return requests[0]
+
 def MakeEnv(overrides=None):
        env = {
                'CC': WithProperties("%(cc)s", cc=GetCC),
@@ -383,7 +389,7 @@ for target in targets:
                description = "Tagging Git repository",
                command = [home_dir+'/maketag.sh', '-i', '-k', str(gpg_keyid or ''),
                           '-p', str(gpg_passfile or ''), '-v', WithProperties("%(tag:-)s")],
-               workdir = home_dir+'/source.git',
+               path = home_dir+'/source.git',
                env = {'GNUPGHOME': gpg_home},
                haltOnFailure = True,
                doStepIf = IsTaggingRequested,
@@ -394,7 +400,7 @@ for target in targets:
        factory.addStep(ShellCommand(
                name = "switchbranch",
                description = "Checking out Git branch",
-               command = "if [ -d .git ]; then git checkout '%s'; else exit 0; fi" % repo_branch,
+               command = "if [ -d .git ]; then git fetch && git checkout '%s'; else exit 0; fi" % repo_branch,
                haltOnFailure = True,
                doStepIf = IsNoTaggingRequested
        ))
@@ -756,7 +762,7 @@ for target in targets:
 
        from buildbot.config import BuilderConfig
 
-       c['builders'].append(BuilderConfig(name=target, slavenames=slaveNames, factory=factory))
+       c['builders'].append(BuilderConfig(name=target, slavenames=slaveNames, factory=factory, nextBuild=GetNextBuild))
 
 
 ####### STATUS TARGETS