phase1: remove redundant git steps and document
authorThibaut VARÈNE <hacks@slashdirt.org>
Thu, 21 Jun 2018 16:39:41 +0000 (18:39 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 26 Jun 2018 20:08:46 +0000 (22:08 +0200)
Based on buildbot documentation and the contents of
`buildbot/steps/source/git.py'

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
phase1/master.cfg

index c856cf3f5414b7612eeb5829fd475d56ea31daf3..a184f4b1b9823f58f8ab7a07b3b1b64579515969 100644 (file)
@@ -482,24 +482,18 @@ for target in targets:
                        doStepIf = IsMakeCleanRequested(tuple[0])
                ))
 
-       # switch to branch
-       factory.addStep(ShellCommand(
-               name = "switchbranch",
-               description = "Checking out Git branch",
-               command = "if [ -d .git ]; then git fetch && git checkout '%s'; else exit 0; fi" % repo_branch,
-               haltOnFailure = True,
-               doStepIf = IsNoTaggingRequested,
-               locks = NetLockDl,
-       ))
-
        # check out the source
-       # method clean runs 'git clean -d -f', method fresh runs 'git clean -d -f x'. Only works with mode='full'
+       # Git() runs:
+         # if repo doesn't exist: 'git clone repourl'
+         # method 'clean' runs 'git clean -d -f', method fresh runs 'git clean -d -f x'. Only works with mode='full'
+         # 'git fetch -t repourl branch; git reset --hard revision'
        factory.addStep(Git(
                repourl = repo_url,
                branch = repo_branch,
                mode = 'full',
                method = 'clean',
                locks = NetLockDl,
+               haltOnFailure = True,
        ))
 
        # update remote refs
@@ -510,16 +504,6 @@ for target in targets:
                haltOnFailure = True
        ))
 
-       # fetch tags
-       factory.addStep(ShellCommand(
-               name = "fetchtag",
-               description = "Fetching Git tags",
-               command = ["git", "fetch", "--tags", "--", repo_url],
-               haltOnFailure = True,
-               doStepIf = IsTaggingRequested,
-               locks = NetLockDl,
-       ))
-
        # switch to tag
        factory.addStep(ShellCommand(
                name = "switchtag",