try fix git step

This commit is contained in:
Andrei Yankovich 2021-03-30 18:24:33 +03:00
parent 8f3f95f64f
commit f81565e4e6

View File

@ -259,41 +259,19 @@ class Make(BaseModule):
def getFactory(self): def getFactory(self):
factory = super().getFactory() factory = super().getFactory()
def getPreviousStepStatus(steps): factory.addStep(
steps_status = steps.build.getStatus().getSteps() steps.Git(
self_status_index = steps_status.index(steps.step_status) repourl=util.Interpolate('%(prop:repository)s'),
if self_status_index == 0: branch=util.Interpolate('%(prop:branch)s'),
return (None, 0) mode='full',
return steps_status[self_status_index - 1].results method='fresh',
submodules=True,
def doForce(steps): warnOnFailure=True,
return getPreviousStepStatus(steps) haltOnFailure=False,
retryFetch=True,
factory.addSteps([ name='git operations',
steps.Git( description='operations of git like pull clone fetch',
repourl=util.Interpolate('%(prop:repository)s'), )
branch=util.Interpolate('%(prop:branch)s'),
mode='full',
method='fresh',
submodules=True,
warnOnFailure=True,
haltOnFailure=False,
name='git operations',
description='operations of git like pull clone fetch',
),
steps.Git(
repourl=util.Interpolate('%(prop:repository)s'),
branch=util.Interpolate('%(prop:branch)s'),
mode='full',
method='clobber',
submodules=True,
name='git operations force',
doStepIf=doForce,
description='operations of git like pull clone' +
'fetch (force remove all old data)',
)
]
) )
# factory.addStep(self.checkSupportedBuildSystems()) # factory.addStep(self.checkSupportedBuildSystems())