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

Side by Side Diff: tools/bots/dartium_android.py

Issue 185583003: Archive dartium on android builds (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/bots/bot_utils.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """ 6 """
7 Dartium on Android buildbot steps. 7 Dartium on Android buildbot steps.
8 8
9 Runs steps after the buildbot builds Dartium on Android, 9 Runs steps after the buildbot builds Dartium on Android,
10 which should upload the APK to an attached device, and run 10 which should upload the APK to an attached device, and run
11 Dart and chromium tests on it. 11 Dart and chromium tests on it.
12 """ 12 """
13 13
14 import optparse
15 import os
16 import string
14 import sys 17 import sys
15 import optparse 18
19 import bot
20 import bot_utils
21
22 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
23 sys.path.append(os.path.join(SCRIPT_DIR, '..'))
24 import utils
25
26
27 APK_LOCATION = 'apks/Chrome.apk'
28 CS_LOCATION = 'apks/ContentShell.apk'
16 29
17 def GetOptionsParser(): 30 def GetOptionsParser():
18 parser = optparse.OptionParser("usage: %prog [options]") 31 parser = optparse.OptionParser("usage: %prog [options]")
19 parser.add_option("--build-products-dir", 32 parser.add_option("--build-products-dir",
20 help="The directory containing the products of the build.") 33 help="The directory containing the products of the build.")
21 return parser 34 return parser
22 35
36
37 def UploadSetACL(gsutil, local, remote):
38 gsutil.upload(local, remote)
39 gsutil.setGroupReadACL(remote, 'google.com')
40 gsutil.setContentType(remote, 'application/vnd.android.package-archive')
41
42
43 def UploadAPKs(options):
44 with bot.BuildStep('Upload apk'):
45 revision = utils.GetSVNRevision()
46 namer = bot_utils.GCSNamer(internal=True)
47 gsutil = bot_utils.GSUtil()
48
49
50 # Archive dartuim
51 local = os.path.join(options.build_products_dir, APK_LOCATION)
52 # TODO(whesse): pass in arch and mode from reciepe
53 remote = namer.dartium_android_apk_filepath(revision,
54 'dartium-android',
55 'arm',
56 'release')
57 web_link_prefix = 'https://storage.cloud.google.com/'
58 dartium_link = string.replace(remote, 'gs://', web_link_prefix)
59 UploadSetACL(gsutil, local, remote)
60 print "Uploaded dartium, available from: %s" % dartium_link
61
62 # Archive content shell
63 local = os.path.join(options.build_products_dir, CS_LOCATION)
64 # TODO(whesse): pass in arch and mode from reciepe
65 remote = namer.dartium_android_apk_filepath(revision,
66 'content_shell-android',
67 'arm',
68 'release')
69 content_shell_link = string.replace(remote, 'gs://', web_link_prefix)
70 UploadSetACL(gsutil, local, remote)
71 print "Uploaded content shell, available from: %s" % content_shell_link
72
23 def main(): 73 def main():
24 if sys.platform != 'linux2': 74 if sys.platform != 'linux2':
25 print "This script was only tested on linux. Please run it on linux!" 75 print "This script was only tested on linux. Please run it on linux!"
26 sys.exit(1) 76 sys.exit(1)
27 77
28 parser = GetOptionsParser() 78 parser = GetOptionsParser()
29 (options, args) = parser.parse_args() 79 (options, args) = parser.parse_args()
30 80
31 if not options.build_products_dir: 81 if not options.build_products_dir:
32 die("No build products directory given.") 82 print "No build products directory given."
83 sys.exit(1)
84
85 UploadAPKs(options)
33 sys.exit(0) 86 sys.exit(0)
34 87
35 if __name__ == '__main__': 88 if __name__ == '__main__':
36 main() 89 main()
OLDNEW
« no previous file with comments | « tools/bots/bot_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698