-
Notifications
You must be signed in to change notification settings - Fork 10
/
jenkins_script.py
37 lines (31 loc) · 1.4 KB
/
jenkins_script.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
#!/usr/bin/env python
import os
import os.path
import subprocess
from optparse import OptionParser
parser = OptionParser()
parser.add_option('--debug', dest='debug', action='store_true')
parser.add_option('--release', dest='debug', action='store_false', default=False)
parser.add_option('--type', dest='type', type='choice', choices=['oncommit', 'nightly', 'integration_tests', 'publish'],
default='oncommit', help='Build type: oncommit, nightly, integration_tests, publish')
(opts, args) = parser.parse_args()
cenv=os.environ
cdir=cenv['WORKSPACE']
scrd=cenv['WORKSPACE']
if cenv['PLATFORM'].startswith('Windows-'):
ext='.bat'
else:
ext=''
type_cargs = {
'oncommit' : ['--steps=default', '--incremental-fetch'],
'nightly' : ['--steps=default,-test,test_full', '--incremental-fetch'],
# 'publish' : ['--steps=-test,-integration_test,default,publish', '--incremental-fetch', '--publish-version', cenv.get('RELEASE_VERSION')],
'publish' : ['--steps=-test,default,publish', '--incremental-fetch', '--publish-version', cenv.get('RELEASE_VERSION')],
'integration_tests' : ['--steps=fetch,configure,clean,build,install,integration_test_full',]
}
cargs = type_cargs[opts.type] + ['-t', cenv['PLATFORM']]
if opts.debug:
cargs += ['--debug',]
else:
cargs += ['--release',]
subprocess.check_call(args=[os.path.join(scrd, 'ohMediaPlayer', 'go' + ext), 'ci-build'] + cargs, cwd=cdir)