summaryrefslogtreecommitdiff
path: root/cbuildbot/stages/sync_stages.py
diff options
context:
space:
mode:
authorDon Garrett <dgarrett@google.com>2015-03-26 18:16:33 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-03-31 23:00:39 +0000
commit999442f50f2b9803f1dcbd37fc0a28608afc405d (patch)
treef7000ad9935fb1b82d194f72eadbc6534e7aab4c /cbuildbot/stages/sync_stages.py
parent72fb8d4630a3f670dadbbf8ee2e684dd9c39e90b (diff)
downloadchromite-999442f50f2b9803f1dcbd37fc0a28608afc405d.tar.gz
sync_stage: Start publishing Project SDK manifests to GS.
Publish each new Project SDK manifest to gs://brillo-releases/sdk-releases/ in addition to manifest-versions. We will eventually stop using manifest-versions for fetching SDKs, but will probably keep publishing manifests there, since that is what triggers the Project SDK builders. BUG=brillo:630 TEST=lint + unittests Change-Id: If9d1465c8b27361f062c2216504079192ef012d4 Reviewed-on: https://chromium-review.googlesource.com/262739 Reviewed-by: Don Garrett <dgarrett@chromium.org> Tested-by: Don Garrett <dgarrett@chromium.org> Commit-Queue: Don Garrett <dgarrett@chromium.org>
Diffstat (limited to 'cbuildbot/stages/sync_stages.py')
-rw-r--r--cbuildbot/stages/sync_stages.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/cbuildbot/stages/sync_stages.py b/cbuildbot/stages/sync_stages.py
index e9fffa0ad..54564f4ee 100644
--- a/cbuildbot/stages/sync_stages.py
+++ b/cbuildbot/stages/sync_stages.py
@@ -35,6 +35,7 @@ from chromite.lib import commandline
from chromite.lib import cros_build_lib
from chromite.lib import cros_logging as logging
from chromite.lib import git
+from chromite.lib import gs
from chromite.lib import osutils
from chromite.lib import patch as cros_patch
from chromite.scripts import cros_mark_chrome_as_stable
@@ -617,10 +618,25 @@ class ManifestVersionedSyncStage(SyncStage):
git.AddPath(latest_manifest_path)
git.Commit(git_repo, 'Create project_sdk for %s.' % current_version)
- # Push it.
+ # Push it to Gerrit.
logging.info('Pushing Project SDK Manifest.')
git.PushWithRetry(branch, git_repo)
+ # Push to GS.
+ gs_ctx = gs.GSContext(dry_run=self._run.debug)
+ publish_uri = os.path.join(constants.BRILLO_RELEASE_MANIFESTS_URL,
+ sdk_manifest_name)
+
+ # We use the default ACL (public readable) for this file.
+ logging.info('Pushing Project SDK Manifest to: %s', publish_uri)
+ gs_ctx.Copy(manifest, publish_uri)
+
+ # Populate a file on GS with the newest version published.
+ with tempfile.NamedTemporaryFile() as latest:
+ osutils.WriteFile(latest.name, current_version)
+ gs_ctx.Copy(latest.name, constants.BRILLO_LATEST_RELEASE_URL)
+
+ # Log what we published.
logging.info('Project SDK Manifest \'%s\' published:',
os.path.basename(sdk_manifest_path))
logging.info('%s', osutils.ReadFile(manifest))
@@ -652,6 +668,7 @@ class ManifestVersionedSyncStage(SyncStage):
next_manifest, filter_cros=self._run.options.local) as new_manifest:
self.ManifestCheckout(new_manifest)
+ # TODO(dgarrett): Push this logic into it's own stage.
# If we are a Canary Master, create an additional derivative Manifest for
# the Project SDK builders.
if (cbuildbot_config.IsCanaryType(self._run.config.build_type) and