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

Unified Diff: tools/bots/src-tarball.py

Issue 198723006: Add archiving of src tarball and debian packages (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
« tools/bots/bot_utils.py ('K') | « tools/bots/bot_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bots/src-tarball.py
===================================================================
--- tools/bots/src-tarball.py (revision 33747)
+++ tools/bots/src-tarball.py (working copy)
@@ -36,19 +36,38 @@
return bot.BuildInfo('none', 'none', 'release', 'linux')
+def ArchiveArtifacts(tarfile, builddir, channel):
+ namer = bot_utils.GCSNamer(channel=channel)
+ gsutil = bot_utils.GSUtil()
+ revision = utils.GetSVNRevision()
+ # Archive the src tar to the src dir
+ remote_tarfile = '/'.join([namer.src_directory(revision),
+ os.path.basename(tarfile)])
+ gsutil.upload(tarfile, remote_tarfile, public=True)
+ # Archive all files except the tar file to the linux packages dir
+ for entry in os.listdir(builddir):
+ full_path = os.path.join(builddir, entry)
+ # We expect a flat structure, not subdirectories
+ assert(os.path.isfile(full_path))
+ if full_path != tarfile:
+ remote_file = '/'.join([namer.linux_packages_directory(revision),
+ os.path.basename(entry)])
+ gsutil.upload(full_path, remote_file, public=True)
+
def SrcSteps(build_info):
# We always clobber the bot, to not leave old tarballs and packages
# floating around the out dir.
bot.Clobber(force=True)
+ version = utils.GetVersion()
+ builddir = os.path.join(bot_utils.DART_DIR,
+ utils.GetBuildDir(HOST_OS, HOST_OS),
+ 'src_and_installation')
+ if not os.path.exists(builddir):
+ os.makedirs(builddir)
+ tarfilename = 'dart-%s.tar.gz' % version
+ tarfile = os.path.join(builddir, tarfilename)
+
with bot.BuildStep('Create src tarball'):
- version = utils.GetVersion()
- builddir = os.path.join(bot_utils.DART_DIR,
- utils.GetBuildDir(HOST_OS, HOST_OS),
- 'src_and_installation')
- if not os.path.exists(builddir):
- os.makedirs(builddir)
- tarfilename = 'dart-%s.tar.gz' % version
- tarfile = os.path.join(builddir, tarfilename)
args = [sys.executable, './tools/create_tarball.py', '--tar_filename',
tarfile]
print 'Building src tarball'
@@ -58,6 +77,14 @@
'--tar_filename', tarfile,
'--out_dir', builddir]
bot.RunProcess(args)
+
+ with bot.BuildStep('Upload artifacts'):
+ bot_name, _ = bot.GetBotName()
+ channel = bot_utils.GetChannelFromName(bot_name)
+ if channel != bot_utils.Channel.BLEEDING_EDGE:
+ ArchiveArtifacts(tarfile, builddir, channel)
+ else:
+ print 'Not uploading artifacts on bleeding edge'
if __name__ == '__main__':
# We pass in None for build_step to avoid building the sdk.
« tools/bots/bot_utils.py ('K') | « tools/bots/bot_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698