OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2014, 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 """ | 7 """ |
8 Buildbot steps for src tarball generation and debian package generation | 8 Buildbot steps for src tarball generation and debian package generation |
9 | 9 |
10 Package up the src of the dart repo and create a debian package. | 10 Package up the src of the dart repo and create a debian package. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 bot.Clobber(force=True) | 61 bot.Clobber(force=True) |
62 version = utils.GetVersion() | 62 version = utils.GetVersion() |
63 builddir = os.path.join(bot_utils.DART_DIR, | 63 builddir = os.path.join(bot_utils.DART_DIR, |
64 utils.GetBuildDir(HOST_OS, HOST_OS), | 64 utils.GetBuildDir(HOST_OS, HOST_OS), |
65 'src_and_installation') | 65 'src_and_installation') |
66 if not os.path.exists(builddir): | 66 if not os.path.exists(builddir): |
67 os.makedirs(builddir) | 67 os.makedirs(builddir) |
68 tarfilename = 'dart-%s.tar.gz' % version | 68 tarfilename = 'dart-%s.tar.gz' % version |
69 tarfile = os.path.join(builddir, tarfilename) | 69 tarfile = os.path.join(builddir, tarfilename) |
70 | 70 |
| 71 with bot.BuildStep('Validating linux system'): |
| 72 print 'Validating that we are on %s' % build_info.builder_tag |
| 73 args = ['uname', '-a'] |
| 74 (stdout, stderr, exitcode) = bot_utils.run(args) |
| 75 if exitcode != 0: |
| 76 print "Could not find linux system, exiting" |
| 77 sys.exit(1) |
| 78 |
| 79 if build_info.builder_tag == "debian_wheezy": |
| 80 if not "Debian" in stdout: |
| 81 print "Trying to build debian bits on a non debian system" |
| 82 sys.exit(1) |
| 83 if build_info.builder_tag == "ubuntu_precise": |
| 84 if not "Ubuntu" in stdout: |
| 85 print "Trying to build ubuntu bits on a non ubuntu system" |
| 86 sys.exit(1) |
| 87 |
71 with bot.BuildStep('Create src tarball'): | 88 with bot.BuildStep('Create src tarball'): |
72 args = [sys.executable, './tools/create_tarball.py', '--tar_filename', | 89 args = [sys.executable, './tools/create_tarball.py', '--tar_filename', |
73 tarfile] | 90 tarfile] |
74 print 'Building src tarball' | 91 print 'Building src tarball' |
75 bot.RunProcess(args) | 92 bot.RunProcess(args) |
76 print 'Building Debian packages' | 93 print 'Building Debian packages' |
77 args = [sys.executable, './tools/create_debian_packages.py', | 94 args = [sys.executable, './tools/create_debian_packages.py', |
78 '--tar_filename', tarfile, | 95 '--tar_filename', tarfile, |
79 '--out_dir', builddir] | 96 '--out_dir', builddir] |
80 bot.RunProcess(args) | 97 bot.RunProcess(args) |
81 | 98 |
82 with bot.BuildStep('Upload artifacts'): | 99 with bot.BuildStep('Upload artifacts'): |
83 bot_name, _ = bot.GetBotName() | 100 bot_name, _ = bot.GetBotName() |
84 channel = bot_utils.GetChannelFromName(bot_name) | 101 channel = bot_utils.GetChannelFromName(bot_name) |
85 if channel != bot_utils.Channel.BLEEDING_EDGE: | 102 if channel != bot_utils.Channel.BLEEDING_EDGE: |
86 ArchiveArtifacts(tarfile, builddir, channel, build_info.builder_tag) | 103 ArchiveArtifacts(tarfile, builddir, channel, build_info.builder_tag) |
87 else: | 104 else: |
88 print 'Not uploading artifacts on bleeding edge' | 105 print 'Not uploading artifacts on bleeding edge' |
89 | 106 |
90 if __name__ == '__main__': | 107 if __name__ == '__main__': |
91 # We pass in None for build_step to avoid building the sdk. | 108 # We pass in None for build_step to avoid building the sdk. |
92 bot.RunBot(SrcConfig, SrcSteps, build_step=None) | 109 bot.RunBot(SrcConfig, SrcSteps, build_step=None) |
OLD | NEW |