From 3acbc71d1266b86d5834272d31b1a6b2b1074fd4 Mon Sep 17 00:00:00 2001 From: hyokeun Date: Mon, 28 Aug 2017 14:17:00 +0900 Subject: [PATCH] Update scripts 1. ABS: Send email notification only for failed build. 2. Fix: Add null condition in job_request.py 3. Update script: job_update_gbs_meta.py Change-Id: I6109ea2e244a28cdd7fe95105686fd7de6bd2dc9 --- abs/job_abs_build.py | 4 +++- job_request.py | 2 +- job_update_gbs_meta.py | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/abs/job_abs_build.py b/abs/job_abs_build.py index 1986d2b..f3a25d2 100644 --- a/abs/job_abs_build.py +++ b/abs/job_abs_build.py @@ -714,7 +714,9 @@ def start_build(fields): if data.get('buildcheck', None) == None and data.get('type', None) == 'SUBMIT': post_processing(my_tizen_studio, src_git, project_properties, data, builddir, mailer, build) - mailer.send_mail() + # Send mail only for failed build + if 'FAIL' in mailer.email_title: + mailer.send_mail() if 'FAIL' in mailer.email_title: return 1 diff --git a/job_request.py b/job_request.py index dc03dfc..bba4e12 100644 --- a/job_request.py +++ b/job_request.py @@ -195,7 +195,7 @@ def delete_from_obs(prj, pkg, handle_link=None): os.getenv('OBS_API_PASSWD')) # If selected package have both _link and _service file, delete _link. - if is_link_visited == False and handle_link.get('target_project', None) is not None: + if is_link_visited == False and handle_link and handle_link.get('target_project', None) is not None: try: for _pkg in handle_link.get('target_packages', []): print 'Check link for %s' % _pkg diff --git a/job_update_gbs_meta.py b/job_update_gbs_meta.py index 0e3a9ee..65f61aa 100644 --- a/job_update_gbs_meta.py +++ b/job_update_gbs_meta.py @@ -12,7 +12,7 @@ from common.gerrit import Gerrit, get_gerrit_event, GerritError, is_ref_deleted # prepare related global variables workspace = os.getenv('WORKSPACE') -basic_url= os.getenv('URL_PUBLIC_REPO_BASE') + '/snapshots/tizen/' +basic_url= os.getenv('URL_PUBLIC_REPO_BASE') + '/snapshot/tizen/' gbs_meta_default_profile = os.getenv('GBS_META_DEFAULT_PROFILE') gbs_meta_tizen_base_prj = os.getenv('GBS_META_TIZEN_BASE_PRJ') gbs_meta_support_tizen_ver = os.getenv('GBS_META_SUPPORT_TIZEN_VER') @@ -270,14 +270,13 @@ def _update_gbs_conf(ref_list,base_prj_list,commit_msg): for ref_profile in ref_list: profile = ref_profile['profile'] t_ver = ref_profile['t_ver'] - ref_snapshot_url = ref_profile['ref_snapshot_url'] gbs_conf_text += '\n############# '+ t_ver+profile+' #############\n' for repository in ref_profile['repository']: gbs_conf_text += '[repo.'+t_ver+profile+'_'+repository+']\n' - gbs_conf_text += 'url = '+ref_snapshot_url+'repos/'+repository+'/packages/\n' + gbs_conf_text += 'url = '+basic_url+t_ver+profile+'/latest/repos/'+repository+'/packages/\n' gbs_conf_text += '[repo.'+t_ver+profile+'_'+repository+'_debug]\n' - gbs_conf_text += 'url = '+ref_snapshot_url+'repos/'+repository+'/debug/\n\n' + gbs_conf_text += 'url = '+basic_url+t_ver+profile+'/latest/repos/'+repository+'/debug/\n\n' #write gbs_conf_text to default gbs_conf_file, which is scm/meta/gbs-config/gbs.conf print '==================================================\n=========== default gbs.conf file==========\n==================================================\n' @@ -460,3 +459,4 @@ def main(): if __name__ == '__main__': sys.exit(main()) + -- 2.7.4