return CheckCleanProperty
+def IsSharedWorkdir(step):
+ return bool(step.getProperty("shared_wd"))
+
def IsCleanupRequested(step):
- shared_wd = step.getProperty("shared_wd")
- if shared_wd:
+ if IsSharedWorkdir(step):
return False
do_cleanup = step.getProperty("do_cleanup")
if do_cleanup:
return False
def IsExpireRequested(step):
- shared_wd = step.getProperty("shared_wd")
- if shared_wd:
+ if IsSharedWorkdir(step):
return False
else:
return not IsCleanupRequested(step)
factory = BuildFactory()
+ # setup shared work directory if required
+ factory.addStep(ShellCommand(
+ name = "sharedwd",
+ description = "Setting up shared work directory",
+ command = 'test -L "$PWD" || (mkdir -p "../shared-workdir" && rm -rf "$PWD" && ln -s shared-workdir "$PWD")',
+ workdir = ".",
+ haltOnFailure = True,
+ doStepIf = IsSharedWorkdir))
+
# find number of cores
factory.addStep(SetPropertyFromCommand(
name = "nproc",