Commits

Anonymous committed 61c5196

expose late-commit and workers as command line options

  • Participants
  • Parent commits 0e23277

Comments (0)

Files changed (3)

File rbuild/buildmany.py

 class BuildManyCommand(command.BaseCommand):
     help = 'Build many packages in sepparate rmake jobs'
     commands = ['buildmany', ]
+    paramHelp = '[package]*'
+    docs = {
+        'late-commit': 'wait until all builds are done before committing',
+        'workers': 'number of active jobs (default 30)'
+    }
+
+    def addLocalParameters(self, argDef):
+        argDef['late-commit'] = command.NO_PARAM
+        argDef['workers'] = command.ONE_PARAM
 
     def runCommand(self, handle, argSet, args):
+        lateCommit = argSet.pop('late-commit', False)
+        workers = int(argSet.pop('workers', 30))
         _, pkgList = self.requireParameters(args, allowExtra=True)
-        results = handle.MirrorBall.buildmany(pkgList)
+        results = handle.MirrorBall.buildmany(pkgList, lateCommit=lateCommit,
+                workers=workers)
 
         if not results:
             raise errors.PluginError('pacakges failed to build')

File rbuild/mb.py

 
         log.addRootLogger()
 
-    def buildmany(self, packages):
+    def buildmany(self, packages, lateCommit=False, workers=None):
         pkgs = set([ (x, self.conarycfg.buildLabel.asString(), None)
             for x in packages ])
-        return self.builder.buildmany(pkgs, lateCommit=True)
+        return self.builder.buildmany(pkgs, lateCommit=lateCommit,
+                workers=workers)

File updatebot/build/build.py

         ret = self._formatOutput(trvMap)
         return ret
 
-    def buildmany(self, troveSpecs, lateCommit=False):
+    def buildmany(self, troveSpecs, lateCommit=False, workers=None):
         """
         Build many troves in separate jobs.
         @param troveSpecs: list of trove specs
         @return troveMap: dictionary of troveSpecs to built troves
         """
 
-        workers = 30
+        if not workers:
+            workers = 30
+
         if self._cfg.updateMode == 'current':
             dispatcher = PromoteDispatcher(self, workers)
         elif not lateCommit: