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

Side by Side Diff: scripts/master/chromeos_revision_source.py

Issue 8669004: Add arm/tegra2 CQ builders and major cleanup of dead code in chromeos_factory. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/build
Patch Set: 80 Char nit fix, ran presubmit check locally and saw it pass Created 9 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2010 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 """Module for chromium-os-specific git source that dumps revisions."""
6
7 import copy
8
9 from buildbot.steps import source
10 from buildbot.process import buildstep
11
12 # Relative path to revision file for cbuildbot.
13 PFQ_REVISION_FILE = 'chromite/buildbot/revisions.pfq'
14
15 class GitRevisionDropper(source.Source):
16 """Drops a list of revisions from multiple git repositories."""
17
18 name = 'gitrevisiondropper'
19
20 def computeSourceRevision(self, changes):
21 """Creates a list of revision numbers. Revision numbers coming from
22 cros git hooks are folder_name:revision.
23
24 This is a hook method provided by the parent source.Source class and
25 default implementation in source.Source returns None. Return value of this
26 method is be used to set 'revision' argument value for startVC() method."""
27 revision_list = ''
28 if not changes:
29 return None
30
31 def GrabRevision(change):
32 """Handle revision == None or any invalid value."""
33 return '%s@%s' % (change.repository, change.revision)
34
35 for change in changes:
36 revision = GrabRevision(change)
37 revision_list = '%s %s' % (revision_list, revision)
38 revision_list = revision_list.strip()
39 return revision_list
40
41 def startVC(self, branch, revision, patch):
42 """Drops a source stamp for other steps"""
43 args = copy.copy(self.args)
44 args['command'] = 'echo "%s" > %s' % (revision, PFQ_REVISION_FILE)
45 # Shell is defined by buildbot.slave.SlaveShellCommand.
46 cmd = buildstep.LoggedRemoteCommand("shell", args)
47 self.startCommand(cmd, [])
OLDNEW
« no previous file with comments | « masters/master.tryserver.chromium/master.cfg ('k') | scripts/master/factory/chromeos_factory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698