From: hyokeun Date: Wed, 28 Sep 2016 04:13:50 +0000 (+0900) Subject: Trigger post-image-creation job with failed status if imager stucked X-Git-Tag: submit/trunk/20190927.012743~574^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F89998%2F1;p=services%2Fjenkins-scripts.git Trigger post-image-creation job with failed status if imager stucked Problem: When image creation job stucked and aborted itself, post-image-creation job will not be called. Fix: Prepare dummy failed trigger infomation. It will always trigger remaining job. Change-Id: I8d73ff72ffdfd77f25133ac19b7d82b0db37bcfc --- diff --git a/job_imager.py b/job_imager.py index d75c979..310ba97 100755 --- a/job_imager.py +++ b/job_imager.py @@ -228,6 +228,18 @@ def main(): outdir = os.path.join(basedir, 'out') os.makedirs(outdir) + url = os.path.join(fields.get('url_pub_base', ''), + fields['repo_path'], fields['images_path']) + + # Triggering DUMMY post-image-creation + data = {"image_xml": "\n", + "name": fields['name'], + "project": fields.get('project', ''), + "status": "failed", + "url": url + } + trigger_next("POST-IMAGE-CREATION", data) + ksf = os.path.join(outdir, '%s.ks' % name) with open(ksf, 'w') as ks_fh: ks_fh.write(fields["kickstart"]) @@ -299,9 +311,6 @@ def main(): xml_string = get_xml(os.path.join(outdir, build_id), name) - url = os.path.join(fields.get('url_pub_base', ''), - fields['repo_path'], fields['images_path']) - # All project will trigger the post-image-creation # Trigger info for post image creation job data = {"image_xml": xml_string,