OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 # Dart Editor promote tools. | 7 # Dart Editor promote tools. |
8 | 8 |
9 import imp | 9 import imp |
10 import optparse | 10 import optparse |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 to_loc = release_namer.apidocs_zipfilepath(to_revision) | 136 to_loc = release_namer.apidocs_zipfilepath(to_revision) |
137 Gsutil(['-m', 'cp', '-a', 'public-read', from_loc, to_loc]) | 137 Gsutil(['-m', 'cp', '-a', 'public-read', from_loc, to_loc]) |
138 | 138 |
139 # Copy dartium directory. | 139 # Copy dartium directory. |
140 from_loc = raw_namer.dartium_directory(revision) | 140 from_loc = raw_namer.dartium_directory(revision) |
141 to_loc = release_namer.dartium_directory(to_revision) | 141 to_loc = release_namer.dartium_directory(to_revision) |
142 remove_gs_directory(to_loc) | 142 remove_gs_directory(to_loc) |
143 Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc]) | 143 Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc]) |
144 | 144 |
145 # Copy wheezy linux deb and src packages. | 145 # Copy wheezy linux deb and src packages. |
146 from_loc = raw_namer.linux_packages_directory(revision, 'debian_wheezy') | 146 from_loc = raw_namer.linux_packages_directory(revision) |
147 to_loc = release_namer.linux_packages_directory(to_revision, | 147 to_loc = release_namer.linux_packages_directory(to_revision) |
148 'debian_wheezy') | |
149 remove_gs_directory(to_loc) | 148 remove_gs_directory(to_loc) |
150 Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc]) | 149 Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc]) |
151 | 150 |
152 # Copy VERSION file. | 151 # Copy VERSION file. |
153 from_loc = raw_namer.version_filepath(revision) | 152 from_loc = raw_namer.version_filepath(revision) |
154 to_loc = release_namer.version_filepath(to_revision) | 153 to_loc = release_namer.version_filepath(to_revision) |
155 Gsutil(['cp', '-a', 'public-read', from_loc, to_loc]) | 154 Gsutil(['cp', '-a', 'public-read', from_loc, to_loc]) |
156 | 155 |
157 promote(revision) | 156 promote(revision) |
158 promote('latest') | 157 promote('latest') |
159 | 158 |
160 def Gsutil(cmd, throw_on_error=True): | 159 def Gsutil(cmd, throw_on_error=True): |
161 gsutilTool = join(DART_PATH, 'third_party', 'gsutil', 'gsutil') | 160 gsutilTool = join(DART_PATH, 'third_party', 'gsutil', 'gsutil') |
162 command = [sys.executable, gsutilTool] + cmd | 161 command = [sys.executable, gsutilTool] + cmd |
163 if DRY_RUN: | 162 if DRY_RUN: |
164 print "DRY runnning: %s" % command | 163 print "DRY runnning: %s" % command |
165 return | 164 return |
166 return bot_utils.run(command, throw_on_error=throw_on_error) | 165 return bot_utils.run(command, throw_on_error=throw_on_error) |
167 | 166 |
168 | 167 |
169 if __name__ == '__main__': | 168 if __name__ == '__main__': |
170 sys.exit(main()) | 169 sys.exit(main()) |
OLD | NEW |