Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(687)

Side by Side Diff: scripts/master/factory/commands.py

Issue 157073002: Bot update! (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Review fix Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | scripts/slave/bot_update.py » ('j') | scripts/slave/bot_update.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Set of utilities to add commands to a buildbot factory (BuildFactory). 5 """Set of utilities to add commands to a buildbot factory (BuildFactory).
6 6
7 All the utility functions to add steps to a build factory here are not 7 All the utility functions to add steps to a build factory here are not
8 project-specific. See the other *_commands.py for project-specific commands. 8 project-specific. See the other *_commands.py for project-specific commands.
9 """ 9 """
10 10
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 command=cmd) 928 command=cmd)
929 929
930 def AddBotUpdateStep(self, env, gclient_specs, revision_mapping, server=None): 930 def AddBotUpdateStep(self, env, gclient_specs, revision_mapping, server=None):
931 """Add a step to force checkout to some state. 931 """Add a step to force checkout to some state.
932 932
933 This is meant to replace all gclient revert/sync steps. 933 This is meant to replace all gclient revert/sync steps.
934 """ 934 """
935 cmd = ['python', self._bot_update_tool, '--specs', gclient_specs] 935 cmd = ['python', self._bot_update_tool, '--specs', gclient_specs]
936 936
937 PROPERTIES = { 937 PROPERTIES = {
938 'root': '%(root:~src)s', 938 'root': '%(root:-)s',
939 'issue': '%(issue:-)s', 939 'issue': '%(issue:-)s',
940 'patchset': '%(patchset:-)s', 940 'patchset': '%(patchset:-)s',
941 'master': '%(mastername:-)s' 941 'master': '%(mastername:-)s',
942 'revision': '%(revision:-)s',
943 'patch_url': '%(patch_url:-)s',
944 'slave_name': '%(slavename:-)s',
945 'builder_name': '%(buildername:-)s',
942 } 946 }
943 947
944 for property_name, property_expr in PROPERTIES.iteritems(): 948 for property_name, property_expr in PROPERTIES.iteritems():
945 property_value = WithProperties(property_expr) 949 property_value = WithProperties(property_expr)
946 if property_value: 950 if property_value:
947 cmd.extend(['--%s' % property_name, property_value]) 951 cmd.extend(['--%s' % property_name, property_value])
948 952
949 if server: 953 if server:
950 cmd.extend(['--server', server]) 954 cmd.extend(['--rietveld_server', server])
951 955
952 if revision_mapping: 956 if revision_mapping:
953 cmd.extend(['--revision-mapping=%s' % json.dumps(revision_mapping)]) 957 cmd.extend(['--revision-mapping=%s' % json.dumps(revision_mapping)])
954 958
955 self._factory.addStep( 959 self._factory.addStep(
956 chromium_step.AnnotatedCommand, 960 chromium_step.AnnotatedCommand,
957 name='bot update', 961 name='bot update',
958 haltOnFailure=True, 962 haltOnFailure=True,
959 flunkOnFailure=True, 963 flunkOnFailure=True,
960 timeout=600, 964 timeout=600,
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 1299
1296 def commandComplete(self, cmd): 1300 def commandComplete(self, cmd):
1297 out = cmd.logs['stdio'].getText() 1301 out = cmd.logs['stdio'].getText()
1298 build_properties = re.findall('BUILD_PROPERTY ([^=]*)=(.*)', out) 1302 build_properties = re.findall('BUILD_PROPERTY ([^=]*)=(.*)', out)
1299 for propname, value in build_properties: 1303 for propname, value in build_properties:
1300 # findall can return strings containing CR characters, remove with strip. 1304 # findall can return strings containing CR characters, remove with strip.
1301 self.build.setProperty(propname, value.strip(), 'Step') 1305 self.build.setProperty(propname, value.strip(), 'Step')
1302 1306
1303 def getText(self, cmd, results): 1307 def getText(self, cmd, results):
1304 return self.describe(True) + self.messages 1308 return self.describe(True) + self.messages
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/bot_update.py » ('j') | scripts/slave/bot_update.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698