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
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",