[Jenkins] User regex pattern to parse comment body

This commit is contained in:
lm 2014-03-03 18:36:32 +08:00
parent 2fe329199b
commit e0a9020de7
1 changed files with 4 additions and 1 deletions

View File

@ -18,7 +18,10 @@ def main():
#get comment body
comment_body = comment['body']
print comment_body
if(cmp(comment_body.upper(),'[ci rebuild]'.upper()) != 0) :
pattern = re.compile("\[ci(\s+)rebuild\]", re.I)
result = pattern.search(comment_body)
if result is None:
print 'skip build for pull request #' + str(pr_num)
return(0)
issue = payload['issue']