#===============================================================================
# [job_submit.py]
+def get_src_proj_lst(bm_src_prj_lst):
+ print '[%s] enter get_src_proj_lst\n' % (__file__)
+
+ if not os.getenv("DROPPED_PRERELEASE_PROJECTS"):
+ print '[%s] no DROPPED_PRERELEASE_PROJECTS!!\n' % (__file__)
+ return bm_src_prj_lst
+
+ prefix = 'home:prerelease:'
+ dropped_prj_lst = os.getenv("DROPPED_PRERELEASE_PROJECTS").split(',')
+ #print '[%s] dropped_prj_lst(%s)\n' % (__file__, dropped_prj_lst)
+
+ print '[%s] bm_src_prj_lst (%s)\n' % (__file__, bm_src_prj_lst)
+ removed_lst = []
+ for each_src_proj in bm_src_prj_lst:
+ for each_dropped_proj in dropped_prj_lst:
+ #print '[%s] each_src_proj(%s), each_dropped_proj(%s)\n' \
+ # % (__file__, each_src_proj, each_dropped_proj)
+ if each_src_proj.startswith(prefix + each_dropped_proj):
+ removed_lst.append(each_src_proj)
+ break
+
+ # do remove
+ print '[%s] removed_lst(%s), do remove!!\n' % (__file__, removed_lst)
+ bm_src_prj_lst = [x for x in bm_src_prj_lst if x not in removed_lst]
+
+ return bm_src_prj_lst
+
def truncate_msg(msg):
MAX_MSG_LEN = int(os.getenv("BUILDMONITOR_MAX_MSG_LEN"))
ret_msg = (msg[:MAX_MSG_LEN-2] + '..') if len(msg) > MAX_MSG_LEN else msg
gerrit_account_name = content.get("gerrit_account_name")
bm_start_datetime = content.get("bm_start_datetime")
bm_end_datetime = content.get("bm_end_datetime")
- bm_src_project_lst = content.get("bm_src_project_lst")
+ bm_src_project_lst = get_src_proj_lst(content.get("bm_src_project_lst"))
+
+ # empty check
+ if not bm_src_project_lst:
+ print '[%s] bm_src_project_lst is empty, skip Submit stage!!\n' \
+ % (__file__)
+ return
# func call
### sr_status -> sr_commit -> sr_stage & sr_status_detail