1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
19 # Runs on buildbot slave, creating a release package using the build
20 # system and zipping it into buildbot_upload.zip. This is then uploaded
21 # to the master in the next buildbot step.
30 sys.stderr.write("Not enough arguments, expecting builder name\n")
35 # scons does own packaging
36 if builder.find('scons') != -1:
37 os.chdir('../blender')
38 retcode = subprocess.call(['python', 'scons/scons.py', 'BF_QUICK=slnt', 'buildslave'])
41 # clean release directory if it already exists
44 if os.path.exists(dir):
45 for f in os.listdir(dir):
46 if os.path.isfile(os.path.join(dir, f)):
47 os.remove(os.path.join(dir, f))
49 # create release package
51 subprocess.call(['make', 'package_archive'])
53 sys.stderr.write('Make package release failed' + str(ex) + '\n')
56 # find release directory, must exist this time
57 if not os.path.exists(dir):
58 sys.stderr.write("Failed to find release directory.\n")
61 # find release package
65 for f in os.listdir(dir):
66 rf = os.path.join(dir, f)
67 if os.path.isfile(rf) and f.startswith('blender'):
72 sys.stderr.write("Failed to find release package.\n")
77 upload_zip = "buildbot_upload.zip"
78 if os.path.exists(upload_zip):
80 z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
81 z.write(filepath, arcname=file)
84 sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')