modify args of [console].

This commit is contained in:
andyque 2014-03-20 10:24:10 +08:00
parent 2f5e9ed654
commit 4bd7a60ca9
2 changed files with 8 additions and 17 deletions

View File

@ -17,6 +17,8 @@ if os.environ.has_key('payload'):
console_cmd = payload['console'] console_cmd = payload['console']
print 'console_param:',console_param print 'console_param:',console_param
console_param_arr = console_param.split(' ')
project_types = ['cpp', 'lua'] project_types = ['cpp', 'lua']
PROJ_SUFFIX = 'Proj' PROJ_SUFFIX = 'Proj'
phonePlats = ['mac','ios','android'] phonePlats = ['mac','ios','android']
@ -31,10 +33,6 @@ runSupport = {
'linux' : [0, 0, 1] 'linux' : [0, 0, 1]
} }
_will_run = False
if console_cmd=='run':
_will_run = True
curPlat = sys.platform curPlat = sys.platform
if curPlat.find('linux') >= 0: if curPlat.find('linux') >= 0:
curPlat = 'linux' curPlat = 'linux'
@ -74,7 +72,7 @@ def build_run():
def main(): def main():
clean_project() clean_project()
create_project() create_project()
if _will_run: if console_param_arr.count('run'):
build_run() build_run()
# -------------- main -------------- # -------------- main --------------

View File

@ -28,14 +28,9 @@ def main():
result = pattern.search(comment_body) result = pattern.search(comment_body)
# will check console/console create # will check console/console create
patternCrt = re.compile("\[console(\s+)create\]", re.I) searchConsole = re.search('\[console.*\]', comment_body)
resCrt = patternCrt.search(comment_body)
resRun = None
if resCrt = None:
patternRun = re.compile("\[console\]", re.I)
resRun = patternRun.search(comment_body);
if result is None and resCrt is None and resRun is None: if result is None and searchConsole is None:
print 'skip build for pull request #' + str(pr_num) print 'skip build for pull request #' + str(pr_num)
return(0) return(0)
@ -87,12 +82,10 @@ def main():
job_trigger_url = '' job_trigger_url = ''
if result: if result:
job_trigger_url = os.environ['JOB_TRIGGER_URL'] job_trigger_url = os.environ['JOB_TRIGGER_URL']
if resultCrt: if searchConsole:
consoleOper = searchConsole.group()
job_trigger_url = os.environ['JOB_CONSOLE_TEST_URL'] job_trigger_url = os.environ['JOB_CONSOLE_TEST_URL']
payload_forword['console'] = 'create' payload_forword['console'] = consoleOper
if resultRun:
job_trigger_url = os.environ['JOB_CONSOLE_TEST_URL']
payload_forword['console'] = 'run'
print 'job_trigger_url is: ', job_trigger_url print 'job_trigger_url is: ', job_trigger_url
#send trigger and payload #send trigger and payload