Skip to content
Snippets Groups Projects
Commit 59bdd559 authored by Don Garrett's avatar Don Garrett
Browse files

Create bbuildbot config repository.

This contains the manifest and configuration (along with supporting
code) for a brillo continuous builder config (bbuildbot).

BUG=chromium:558660
TEST=Not fully testable before commit.

Change-Id: I2df555014b6efc4503c3ba888a82801ec6cde9c6
parent b12db961
No related branches found
No related tags found
No related merge requests found
# Generated files
*.pyc
*~
*.swp
.project
.pydevproject
# source cross-reference files.
tags
.ctags
cscope.out
This repository exists to configure cbuildbot based bruteus builds.
To check this out as a repo checkout:
repo init -u https://android.googlesource.com/platform/bbuildbot_config
To perform a local build:
bin/cbuildbot --buildroot ~/tmp/test_buildroot \
--buildbot --debug --config_repo \
https://android.googlesource.com/platform/bbuildbot_config \
bbuildbot
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module builders for bbuildbot."""
from __future__ import print_function
import os
from chromite.lib import cros_build_lib
from chromite.lib import osutils
from chromite.cbuildbot.builders import generic_builders
from chromite.cbuildbot.stages import generic_stages
from chromite.cbuildbot.stages import sync_stages
from chromite.cbuildbot import repository
class BrilloStageBase(generic_stages.BuilderStage):
"""Base class for all symbols build stages."""
def BrilloRoot(self):
# Turn /mnt/data/b/cbuild/android -> /mnt/data/b/cbuild/android_brillo
# We have to be OUTSIDE the build root, since this is a new repo checkout.
# We don't want to be in /tmp both because we might not fit, and because the
# initial sync is expensive enough that we don't want to have to redo it if
# avoidable.
return self._run.buildroot + '_brillo'
def BuildOutput(self):
# We store brillo build output in brillo's default output directory.
# (ex: brillo_root/out)
return os.path.join(self.BrilloRoot(), 'out')
class BrilloCleanStage(BrilloStageBase):
"""Compile the Brillo checkout."""
def PerformStage(self):
"""Clean up Brillo build output."""
osutils.RmDir(self.BuildOutput(), ignore_missing=True)
if self._run.options.clobber:
osutils.RmDir(self.BrilloRoot(), ignore_missing=True)
class BrilloSyncStage(BrilloStageBase):
"""Sync Brillo code to a sub-directory."""
def PerformStage(self):
"""Do the sync work."""
osutils.SafeMakedirs(self.BrilloRoot())
# Fetch and/or update the brillo source code.
brillo_repo = repository.RepoRepository(
manifest_repo_url=self._run.config.brillo_manifest_url,
branch=self._run.config.brillo_manifest_branch,
directory=self.BrilloRoot())
brillo_repo.Initialize()
brillo_repo.Sync()
class BrilloBuildStage(BrilloStageBase):
"""Compile the Brillo checkout."""
def PerformStage(self):
"""Do the build work."""
cmd_list = []
cmd_list.append('. build/envsetup.sh')
cmd_list.append('lunch brilloemulator_arm-eng')
cmd_list.append('OUT_DIR=%s' % self.BuildOutput())
cmd_list.append('make -j 32')
# We use a shell invocation so environmental variables are preserved.
cmd = ' && '.join(cmd_list)
cros_build_lib.RunCommand(cmd, shell=True, cwd=self.BrilloRoot())
class BrilloBuilder(generic_builders.Builder):
"""Builder that performs sync, then exits."""
def GetSyncInstance(self):
"""Returns an instance of a SyncStage that should be run."""
return self._GetStageInstance(sync_stages.SyncStage)
def RunStages(self):
"""Run something after sync/reexec."""
self._RunStage(BrilloCleanStage)
self._RunStage(BrilloSyncStage)
self._RunStage(BrilloBuildStage)
{
"_default": {
"boards": [],
"manifest_repo_url": "https://chromium.googlesource.com/chromiumos/chromite/abuildbot_config"
},
"_site_params": {
"ARCHIVE_URL": "gs://abuildbot-build-archive/bbuildbot"
},
"_templates": {},
"bbuildbot": {
"builder_class_name": "config.builders.brillo_builders.BrilloBuilder",
"brillo_manifest_url": "https://android.googlesource.com/brillo/manifest",
"brillo_manifest_branch": "master"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="cros"
fetch="https://chromium.googlesource.com"
review="https://chromium-review.googlesource.com" />
<remote name="cros-internal"
fetch="https://chrome-internal.googlesource.com"
review="https://chrome-internal-review.googlesource.com" />
<default revision="refs/heads/master"
remote="cros" sync-j="8" />
<notice>
Your sources have been sync'd successfully.
</notice>
<project path="chromite" name="chromiumos/chromite" />
<project path="chromite/config" name="brillo/bbuildbot_config"
remote="cros-internal" />
<!-- To get requirements for cros lint -->
<project path="chromium/tools/depot_tools"
name="chromium/tools/depot_tools"
revision="b6795643ec0305ba2ff862fcd0f450756aa5e58c" />
</manifest>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment