-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjenkins.py
executable file
·43 lines (33 loc) · 953 Bytes
/
jenkins.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import os
import subprocess
import sys
def do_call(args):
oneline = ['"{}"'.format(x) for x in args]
oneline = ' '.join(oneline)
print('[{}]> {}'.format(os.getcwd(), oneline))
try:
subprocess.check_call(args, env=os.environ)
except subprocess.CalledProcessError as error:
print(error)
print(error.output)
sys.exit(1)
def run_django_unittests():
os.chdir('example')
do_call(['./manage.py', 'jenkins'])
os.chdir('..')
def run_unittests():
print('Running unittests')
run_django_unittests()
do_call([
"pylint", "--load-plugins", "pylint_django",
"django_data_explorer",
"example/data_explorer_example"
])
do_call(['which', 'npm'])
do_call(['npm', 'install'])
do_call(['npm', 'test'])
if __name__ == "__main__":
run_unittests()