From 05417a5d3066ca1ed145020abaa7ff8e77fe897c Mon Sep 17 00:00:00 2001 From: ZhuoX Li Date: Mon, 29 Sep 2014 14:30:09 +0800 Subject: [PATCH] Publish 'pre_created' event to IRIS Publish 'pre_created' event when a pre_project is created for a submission tag Change-Id: Ib824f46e7d1163b18d780e395328ff2e1ee56eab --- job_submit.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/job_submit.py b/job_submit.py index 3cd8e81..7e8b007 100755 --- a/job_submit.py +++ b/job_submit.py @@ -120,7 +120,9 @@ def main(build_type): if git_branch == 'trunk': git_branch = 'master' - if os.getenv("IRIS_PUB_ENABLED", "0") != "0": + # add submitted log for iris + pub_enabled = os.getenv("IRIS_PUB_ENABLED", "0") != "0" + if pub_enabled: rest = IrisRestClient( os.getenv("IRIS_SERVER"), os.getenv("IRIS_USERNAME"), @@ -163,6 +165,13 @@ def main(build_type): submitter += ' <%s>' % gerrit_account_email create_project(url, gerrit_project, git_tag, gerrit_newrev, build, obs_target_prj, project, submitter, package) + if pub_enabled: + rest.publish_event("pre_created", { + "project": project, + "tag": git_tag, + "product": obs_target_prj, + "gitpath": gerrit_project, + }) elif build_type == 'snapshot': if not is_ref_deleted(gerrit_oldrev, gerrit_newrev): if build.exists(obs_target_prj): -- 2.7.4