| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Archive builds from the multivm and dartium perf builders | 7 """Archive builds from the multivm and dartium perf builders |
| 8 | 8 |
| 9 Archive dartium, content_shell, and chromedriver to the old cloud storage bucket | 9 Archive dartium, content_shell, and chromedriver to the old cloud storage bucket |
| 10 gs://dartium-archive. | 10 gs://dartium-archive. |
| 11 """ | 11 """ |
| 12 | 12 |
| 13 import os | 13 import os |
| 14 import platform | 14 import platform |
| 15 import re | 15 import re |
| 16 import subprocess | 16 import subprocess |
| 17 import sys | 17 import sys |
| 18 | 18 |
| 19 import dartium_bot_utils | 19 import dartium_bot_utils |
| 20 import upload_steps | 20 import upload_steps |
| 21 | 21 |
| 22 SRC_PATH = dartium_bot_utils.srcPath() | 22 SRC_PATH = dartium_bot_utils.srcPath() |
| 23 | 23 |
| 24 def main(): | 24 def main(): |
| 25 multivm_deps = os.path.join(os.path.dirname(SRC_PATH), 'multivm.deps') | 25 if (upload_steps.BuildInfo('', '').channel == 'be'): |
| 26 revision_directory = (multivm_deps if (os.path.isdir(multivm_deps)) | 26 revision = sys.argv[1] |
| 27 else os.path.join(SRC_PATH, 'dart')) | 27 else: |
| 28 output, _ = subprocess.Popen(['svn', 'info'], | 28 multivm_deps = os.path.join(os.path.dirname(SRC_PATH), 'multivm.deps') |
| 29 stdout=subprocess.PIPE, | 29 revision_directory = (multivm_deps if (os.path.isdir(multivm_deps)) |
| 30 stderr=subprocess.STDOUT, | 30 else os.path.join(SRC_PATH, 'dart')) |
| 31 shell=(platform.system() == 'Windows'), | 31 output, _ = subprocess.Popen(['svn', 'info'], |
| 32 cwd=revision_directory).communicate() | 32 stdout=subprocess.PIPE, |
| 33 revision = re.search('Last Changed Rev: (\d+)', output).group(1) | 33 stderr=subprocess.STDOUT, |
| 34 shell=(platform.system() == 'Windows'), |
| 35 cwd=revision_directory).communicate() |
| 36 revision = re.search('Last Changed Rev: (\d+)', output).group(1) |
| 37 |
| 34 version = revision + '.0' | 38 version = revision + '.0' |
| 35 info = upload_steps.BuildInfo(version, revision) | 39 info = upload_steps.BuildInfo(version, revision) |
| 36 if info.is_build: | 40 if info.is_build: |
| 37 upload_steps.ArchiveAndUpload(info, archive_latest=False) | 41 upload_steps.ArchiveAndUpload(info, archive_latest=False) |
| 38 | 42 |
| 39 if __name__ == '__main__': | 43 if __name__ == '__main__': |
| 40 sys.exit(main()) | 44 sys.exit(main()) |
| OLD | NEW |