electron/script/cibuild

67 lines
1.7 KiB
Text
Raw Normal View History

#!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import execute, rm_rf, scoped_env
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
LINUX_DEPS = [
'libdbus-1-dev',
2014-11-15 02:37:27 +00:00
'libgconf2-dev',
'libgnome-keyring-dev',
'libgtk2.0-dev',
'libnotify-dev',
'gcc-multilib',
'g++-multilib',
]
def main():
2014-02-17 09:50:25 +00:00
os.environ['CI'] = '1'
is_travis = (os.getenv('TRAVIS') == 'true')
if is_travis and sys.platform == 'linux2':
2014-08-09 01:48:37 +00:00
print 'Setup travis CI'
execute(['sudo', 'apt-get', 'update'])
execute(['sudo', 'apt-get', 'install'] + LINUX_DEPS)
2014-08-09 01:48:37 +00:00
os.environ['DISPLAY'] = ':99.0'
execute(['sh', '-e', '/etc/init.d/xvfb', 'start'])
rm_rf(os.path.join(SOURCE_ROOT, 'out'))
2013-12-16 07:15:33 +00:00
rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
2014-02-02 11:58:25 +00:00
rm_rf(os.path.join(SOURCE_ROOT, 'frameworks'))
rm_rf(os.path.join(SOURCE_ROOT, 'external_binaries'))
rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'apm', 'node_modules'))
rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download',
'libchromiumcontent'))
if is_travis and sys.platform == 'linux2':
with scoped_env('CXX', 'g++'):
with scoped_env('CC', 'gcc'):
2015-04-08 08:36:39 +00:00
run_script('bootstrap.py', ['--dev'])
run_script('update.py')
else:
2015-04-08 08:36:39 +00:00
run_script('bootstrap.py', ['--dev'])
run_script('cpplint.py')
2014-03-03 11:31:45 +00:00
if sys.platform != 'win32':
run_script('pylint.py')
2013-09-27 02:49:55 +00:00
run_script('coffeelint.py')
2014-05-18 15:52:14 +00:00
run_script('build.py', ['-c', 'Debug'])
run_script('test.py', ['--ci'])
def run_script(script, args=[]):
2014-05-09 02:17:02 +00:00
print 'Running', script
script = os.path.join(SOURCE_ROOT, 'script', script)
subprocess.check_call([sys.executable, script] + args)
if __name__ == '__main__':
sys.exit(main())