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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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'): | 71 with bot.BuildStep('Validating linux system'): |
72 print 'Validating that we are on %s' % build_info.builder_tag | 72 print 'Validating that we are on %s' % build_info.builder_tag |
73 args = ['uname', '-a'] | 73 args = ['cat', '/etc/os-release'] |
74 (stdout, stderr, exitcode) = bot_utils.run(args) | 74 (stdout, stderr, exitcode) = bot_utils.run(args) |
75 if exitcode != 0: | 75 if exitcode != 0: |
76 print "Could not find linux system, exiting" | 76 print "Could not find linux system, exiting" |
77 sys.exit(1) | 77 sys.exit(1) |
78 | 78 |
79 if build_info.builder_tag == "debian_wheezy": | 79 if build_info.builder_tag == "debian_wheezy": |
80 if not "Debian" in stdout: | 80 if not "wheezy" in stdout: |
81 print "Trying to build debian bits on a non debian system" | 81 print "Trying to build debian bits on a non debian system" |
82 sys.exit(1) | 82 sys.exit(1) |
83 if build_info.builder_tag == "ubuntu_precise": | 83 if build_info.builder_tag == "ubuntu_precise": |
84 if not "Ubuntu" in stdout: | 84 if not "precise" in stdout: |
85 print "Trying to build ubuntu bits on a non ubuntu system" | 85 print "Trying to build ubuntu bits on a non ubuntu system" |
86 sys.exit(1) | 86 sys.exit(1) |
87 | 87 |
88 with bot.BuildStep('Create src tarball'): | 88 with bot.BuildStep('Create src tarball'): |
89 args = [sys.executable, './tools/create_tarball.py', '--tar_filename', | 89 args = [sys.executable, './tools/create_tarball.py', '--tar_filename', |
90 tarfile] | 90 tarfile] |
91 print 'Building src tarball' | 91 print 'Building src tarball' |
92 bot.RunProcess(args) | 92 bot.RunProcess(args) |
93 print 'Building Debian packages' | 93 print 'Building Debian packages' |
94 args = [sys.executable, './tools/create_debian_packages.py', | 94 args = [sys.executable, './tools/create_debian_packages.py', |
95 '--tar_filename', tarfile, | 95 '--tar_filename', tarfile, |
96 '--out_dir', builddir] | 96 '--out_dir', builddir] |
97 bot.RunProcess(args) | 97 bot.RunProcess(args) |
98 | 98 |
99 with bot.BuildStep('Upload artifacts'): | 99 with bot.BuildStep('Upload artifacts'): |
100 bot_name, _ = bot.GetBotName() | 100 bot_name, _ = bot.GetBotName() |
101 channel = bot_utils.GetChannelFromName(bot_name) | 101 channel = bot_utils.GetChannelFromName(bot_name) |
102 if channel != bot_utils.Channel.BLEEDING_EDGE: | 102 # if channel != bot_utils.Channel.BLEEDING_EDGE: |
103 ArchiveArtifacts(tarfile, builddir, channel, build_info.builder_tag) | 103 ArchiveArtifacts(tarfile, builddir, channel, build_info.builder_tag) |
104 else: | 104 # else: |
105 print 'Not uploading artifacts on bleeding edge' | 105 # print 'Not uploading artifacts on bleeding edge' |
106 | 106 |
107 if __name__ == '__main__': | 107 if __name__ == '__main__': |
108 # 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. |
109 bot.RunBot(SrcConfig, SrcSteps, build_step=None) | 109 bot.RunBot(SrcConfig, SrcSteps, build_step=None) |
OLD | NEW |