OLD | NEW |
| (Empty) |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 """Utility class to build the Skia master BuildFactory's for HouseKeeping bots. | |
6 | |
7 Overrides SkiaFactory with Periodic HouseKeeping steps.""" | |
8 | |
9 import builder_name_schema | |
10 | |
11 from config_private import SKIA_PUBLIC_MASTER_INTERNAL_FQDN | |
12 from skia_master_scripts import factory as skia_factory | |
13 | |
14 | |
15 # TODO: The HouseKeepingPeriodicFactory uses shell scripts, so it would break on | |
16 # Windows. For now, we reply on the fact that the housekeeping bot always runs | |
17 # on a Linux machine. | |
18 class HouseKeepingPeriodicFactory(skia_factory.SkiaFactory): | |
19 """Overrides for HouseKeeping periodic builds.""" | |
20 | |
21 def Build(self, role=builder_name_schema.BUILDER_ROLE_HOUSEKEEPER, | |
22 clobber=None): | |
23 """Build and return the complete BuildFactory. | |
24 | |
25 role: string; type of builder. | |
26 clobber: boolean indicating whether we should clean before building | |
27 """ | |
28 if role != builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: | |
29 raise Exception('Housekeeping builders must have role "%s"' % | |
30 builder_name_schema.BUILDER_ROLE_HOUSEKEEPER) | |
31 | |
32 self.UpdateSteps() | |
33 if clobber is None: | |
34 clobber = self._default_clobber | |
35 if clobber: | |
36 self.AddSlaveScript(script='clean.py', description='Clean') | |
37 | |
38 # pylint: disable=W0212 | |
39 clang_static_analyzer_script_path = self.TargetPath.join( | |
40 self._skia_cmd_obj._local_slave_script_dir, | |
41 'run-clang-static-analyzer.sh') | |
42 self._skia_cmd_obj.AddRunCommand( | |
43 command=clang_static_analyzer_script_path, | |
44 description='RunClangStaticAnalyzer') | |
45 | |
46 self.AddSlaveScript(script='check_gs_timestamps.py', | |
47 description='CheckGoogleStorageTimestamps') | |
48 | |
49 if not self._do_patch_step: # Do not run the checkers if it is a try job. | |
50 # pylint: disable=W0212 | |
51 disk_usage_script_path = self.TargetPath.join( | |
52 self._skia_cmd_obj._local_slave_script_dir, | |
53 'check_compute_engine_disk_usage.sh') | |
54 self._skia_cmd_obj.AddRunCommand( | |
55 command=('SKIA_COMPUTE_ENGINE_HOSTNAME=%s PERSISTENT_DISK_NAME=' | |
56 '/home/default/skia-repo %s' | |
57 % (SKIA_PUBLIC_MASTER_INTERNAL_FQDN, | |
58 disk_usage_script_path)), | |
59 description='CheckMasterDiskUsage') | |
60 | |
61 self.Validate() | |
62 return self | |
OLD | NEW |