Chromium Code Reviews| Index: buildbot/cbuildbot_stages.py |
| diff --git a/buildbot/cbuildbot_stages.py b/buildbot/cbuildbot_stages.py |
| index 197a50bf0538cd024460df11592fb229698f92bc..9aa6306058bd531ff21e31503d17fad1d0fa71ef 100644 |
| --- a/buildbot/cbuildbot_stages.py |
| +++ b/buildbot/cbuildbot_stages.py |
| @@ -10,6 +10,7 @@ import sys |
| import tempfile |
| import chromite.buildbot.cbuildbot_commands as commands |
| +import chromite.buildbot.manifest_version as manifest_version |
| import chromite.lib.cros_build_lib as cros_lib |
| _FULL_BINHOST = 'FULL_BINHOST' |
| @@ -257,12 +258,12 @@ class BuilderStage(): |
| class SyncStage(BuilderStage): |
| """Stage that performs syncing for the builder.""" |
| + |
| def _PerformStage(self): |
| if self._options.clobber or not os.path.isdir(os.path.join(self._build_root, |
| '.repo')): |
| commands.FullCheckout(self._build_root, self._options.tracking_branch, |
| - url=self._options.url) |
| - self._ExtractOverlays() |
| + url=self._build_config['git_url']) |
| else: |
| commands.PreFlightRinse(self._build_root, self._build_config['board'], |
| self._options.tracking_branch, |
| @@ -271,10 +272,75 @@ class SyncStage(BuilderStage): |
| commands.IncrementalCheckout(self._build_root) |
| # Check that all overlays can be found. |
| + self._ExtractOverlays() # Our list of overlays are from pre-sync, refresh |
| for path in BuilderStage.rev_overlays: |
| assert os.path.isdir(path), 'Missing overlay: %s' % path |
| +class ManifestVersionedSyncStage(BuilderStage): |
| + """Stage that generates a unique manifest file, and sync's to it.""" |
| + |
| + build_version = None |
| + |
| + def _PerformStage(self): |
| + # Need to determine branch and set a local value here |
| + branch = self._options.tracking_branch.split('/') |
| + increment = 'patch' |
| + |
| + if not branch[1]: |
| + branch[1] = 'master' |
| + increment = 'branch' # TODO Is this right? |
| + |
| + next_version = manifest_version.GenerateWorkload( |
| + tmp_dir='/tmp/git.root', |
| + source_repo=self._build_config['git_url'], |
| + manifest_repo=self._build_config['manifest_version'], |
| + branch=branch[1], |
| + version_file='src/third_party/chromiumos-overlay/chromeos/config' |
|
sosa
2011/04/11 23:34:01
os.path.join
dgarrett
2011/04/12 23:21:56
Done.
|
| + '/chromeos_version.sh', |
| + board=self._build_config['board'], |
| + incr_type= increment, |
|
sosa
2011/04/11 23:34:01
no space
dgarrett
2011/04/12 23:21:56
Done.
|
| + debug=self._options.debug) |
| + |
| + if not next_version: |
| + print "AUTOREV: Nothing to build!" |
|
sosa
2011/04/11 23:34:01
'' not ""
dgarrett
2011/04/12 23:21:56
Done.
|
| + sys.exit(0); |
| + |
| + # Store off this value where the Completion stage can find it... |
| + ManifestVersionedSyncStage.build_version = next_version |
| + |
| + commands.ManifestCheckout(self._build_root, |
| + self._options.tracking_branch, |
| + next_version, |
| + url=self._build_config['manifest_version']) |
| + |
| + # Check that all overlays can be found. |
| + self._ExtractOverlays() # Our list of overlays are from pre-sync, refresh |
| + for path in BuilderStage.rev_overlays: |
| + assert os.path.isdir(path), 'Missing overlay: %s' % path |
| + |
| + |
| +class ManifestVersionedSyncCompletionStage(BuilderStage): |
| + """Stage that records board specific results for a unique manifest file.""" |
| + |
| + def __init__(self, bot_id, options, build_config, success): |
| + BuilderStage.__init__(self, bot_id, options, build_config) |
| + self.success = success |
| + |
| + def _PerformStage(self): |
| + |
| + if not ManifestVersionedSyncStage.build_version: |
|
sosa
2011/04/11 23:34:01
When would we get here? SHouldn't this be an aser
dgarrett
2011/04/12 23:21:56
This stage will be reached, no matter where we err
|
| + # Nothing to do if ManifestVersionedSyncStage didn't complete |
| + return |
| + |
| + manifest_version.UpdateStatus( |
| + tmp_dir='/tmp/git.root', |
| + manifest_repo=self._build_config['manifest_version'], |
| + board=self._build_config['board'], |
| + build_version=ManifestVersionedSyncStage.build_version, |
| + success=self.success, |
| + debug=self._options.debug) |
| + |
| class BuildBoardStage(BuilderStage): |
| """Stage that is responsible for building host pkgs and setting up a board.""" |
| def _PerformStage(self): |