Bug 1179476 - use in gecko tree mozharness across all jobs, MBF support, r=rail
authorJordan Lund <jlund@mozilla.com>
Fri, 17 Jul 2015 09:56:15 -0700 (2015-07-17)
changeset 4341 375f5b855039771e6ee9e77409b3b3013929cb21
parent 4338 87d0a4fb5398c9bfe02f456ffd4c3bdb4b34d6ba
child 4342 4095a3b801e18272450587a9191b5c164034802a
push id3634
push userjlund@mozilla.com
push dateFri, 17 Jul 2015 17:06:16 +0000 (2015-07-17)
reviewersrail
bugs1179476
Bug 1179476 - use in gecko tree mozharness across all jobs, MBF support, r=rail
process/factory.py
--- a/process/factory.py
+++ b/process/factory.py
@@ -1076,64 +1076,55 @@ class MercurialBuildFactory(MozillaBuild
             self.addStep(ShellCommand(command=['ccache', '-s'],
                                       name="print_ccache_stats", warnOnFailure=False,
                                       flunkOnFailure=False, haltOnFailure=False, env=self.env))
         if self.buildsBeforeReboot and self.buildsBeforeReboot > 0:
             self.addPeriodicRebootSteps()
 
     def addMozharnessRepoSteps(self):
         if self.mozharness_repo_cache:
-            # all slaves bar win tests have a copy of hgtool in their path.
-            # However let's use runner's checkout version like we do with
-            # script_repo_cache as we want these cache repos to be the
-            # canonical truth as we roll out runner
             assert self.tools_repo_cache
-            hgtool_path = os.path.join(self.tools_repo_cache,
-                                       'buildfarm',
-                                       'utils',
-                                       'hgtool.py')
-            hgtool_cmd = [
-                'python', hgtool_path, '--purge',
-                '-r', WithProperties('%(script_repo_revision:-default)s'),
-                self.getRepository(self.mozharnessRepoPath),
-                self.mozharness_repo_cache
-            ]
+            archiver_client_path = \
+                os.path.join(self.tools_repo_cache,
+                             'buildfarm',
+                             'utils',
+                             'archiver_client.py')
+        else:
             self.addStep(ShellCommand(
-                name="update_mozharness_repo_cache",
-                command=hgtool_cmd,
-                env=self.env,
-                haltOnFailure=True,
-                workdir=os.path.dirname(self.mozharness_repo_cache),
-            ))
-        else:
-            # fall back to legacy local mozharness full clobber/clone
-            self.addStep(ShellCommand(
-                name='rm_mozharness',
-                command=['rm', '-rf', 'mozharness'],
-                description=['removing', 'mozharness'],
-                descriptionDone=['remove', 'mozharness'],
+                command=['bash', '-c',
+                         'wget -Oarchiver_client.py ' +
+                         '--no-check-certificate --tries=10 --waitretry=3 ' +
+                         'http://hg.mozilla.org/build/tools/raw-file/default/buildfarm/utils/archiver_client.py'],
                 haltOnFailure=True,
                 workdir='.',
             ))
-            self.addStep(MercurialCloneCommand(
-                name='hg_clone_mozharness',
-                command=['hg', 'clone', self.getRepository(
-                    self.mozharnessRepoPath), 'mozharness'],
-                description=['checking', 'out', 'mozharness'],
-                descriptionDone=['checkout', 'mozharness'],
-                haltOnFailure=True,
-                workdir='.',
-            ))
-            self.addStep(ShellCommand(
-                name='hg_update_mozharness',
-                command=['hg', 'update', '-r', self.mozharnessTag],
-                description=['updating', 'mozharness', 'to', self.mozharnessTag],
-                workdir='mozharness',
-                haltOnFailure=True
-            ))
+            archiver_client_path = 'archiver_client.py'
+
+
+        self.addStep(ShellCommand(
+            name='rm_mozharness',
+            command=['rm', '-rf', 'mozharness'],
+            description=['removing', 'mozharness'],
+            descriptionDone=['remove', 'mozharness'],
+            haltOnFailure=True,
+            workdir='.',
+        ))
+        self.addStep(ShellCommand(
+            name="download_and_extract_mozharness_archive",
+            command=['bash', '-c',
+                     WithProperties(
+                         'python %s ' % archiver_client_path +
+                         'mozharness ' +
+                         '--repo %s ' % self.repoPath +
+                         '--rev %(revision)s ' +
+                         '--debug')],
+            log_eval_func=rc_eval_func({0: SUCCESS, None: EXCEPTION}),
+            workdir='.',
+            haltOnFailure=True,
+        ))
 
     def addMultiLocaleRepoSteps(self):
         name = self.compareLocalesRepoPath.rstrip('/').split('/')[-1]
         self.addStep(ShellCommand(
             name='rm_%s' % name,
             command=['rm', '-rf', '%s' % name],
             description=['removing', name],
             descriptionDone=['remove', name],