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

Unified Diff: buildbot/cbuildbot_stages.py

Issue 6691047: Merge MVP script into cbuildbot. (Closed) Base URL: http://git.chromium.org/git/chromite.git@master
Patch Set: Implement Debug option for manifest_version Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: buildbot/cbuildbot_stages.py
diff --git a/buildbot/cbuildbot_stages.py b/buildbot/cbuildbot_stages.py
index 197a50bf0538cd024460df11592fb229698f92bc..b2f1bd0a683ed2749b1d78b8033d8cee6a12d3bb 100644
--- a/buildbot/cbuildbot_stages.py
+++ b/buildbot/cbuildbot_stages.py
@@ -11,6 +11,7 @@ import tempfile
import chromite.buildbot.cbuildbot_commands as commands
import chromite.lib.cros_build_lib as cros_lib
+import chromite.buildbot.manifest_version as manifest_version
_FULL_BINHOST = 'FULL_BINHOST'
PUBLIC_OVERLAY = '%(buildroot)s/src/third_party/chromiumos-overlay'
@@ -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'
+ '/chromeos_version.sh',
+ board=self._build_config['board'],
+ incr_type= increment,
+ debug=self._options.debug)
+
+ if not next_version:
+ print "AUTOREV: Nothing to build!"
+ 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:
+ # 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):

Powered by Google App Engine
This is Rietveld 408576698