From: Yonghee Han Date: Wed, 8 Mar 2017 04:12:21 +0000 (+0900) Subject: Enable OBS_use_specname feature X-Git-Tag: submit/trunk/20190927.012743~519 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F117901%2F1;p=services%2Fjenkins-scripts.git Enable OBS_use_specname feature Change-Id: I791f309991d4a5802614bcd75af1cfc58010500c --- diff --git a/job_submit.py b/job_submit.py index 228bf0e..6f2d53c 100755 --- a/job_submit.py +++ b/job_submit.py @@ -615,24 +615,36 @@ def main(build_type): "tag": git_tag, } submit_info['pre_created'] = [] - + url = 'ssh://%s:%s' % (os.getenv('GERRIT_HOSTNAME'), + os.getenv('GERRIT_SSHPORT')) for item in obs_target_prjs: enable_build = True obs_target_prj = item['OBS_project'] obs_stg_prj = item['OBS_staging_project'] obs_pkg = item['OBS_package'] + obs_use_specname = item['OBS_use_specname'] if 'config' in item and item['config'] is not None and item['config'].build == 'no': print 'Set disable build for %s' % (obs_target_prj) enable_build = False - - url = 'ssh://%s:%s' % (os.getenv('GERRIT_HOSTNAME'), - os.getenv('GERRIT_SSHPORT')) - # get package name from xml files. - if obs_pkg: - package = obs_pkg + if obs_use_specname == 'yes': + # search specfile under packaging directory + specfile = find_specfile(prjdir, packagingdir, tag, event, tagger) + if not specfile: + return 0 + # parse specfile + spec = parse_specfile(specfile, tag, event, tagger) + if not spec: + return 0 + package = spec.name + print 'spec name = %s' %(spec.name) else: + # get package name from xml files. + if obs_pkg: + package = obs_pkg + else: # get package name from gerrit_project - package = os.path.basename(gerrit_project) + package = os.path.basename(gerrit_project) + print 'package name = %s' %(package) if build_type == 'prerelease': if obs_stg_prj != 'prerelease': @@ -654,17 +666,6 @@ def main(build_type): if gerrit_account_email: submitter += ' <%s>' % gerrit_account_email - # search specfile under packaging directory - #specfile = find_specfile(prjdir, packagingdir, tag, event, tagger, obs_pkg,\ - # debug_prj_name=obs_target_prj) - #if not specfile: - # continue - - # parse specfile - #spec = parse_specfile(specfile, tag, event, tagger) - #if not spec: - # continue - retry_count = 3 while retry_count > 0: try: @@ -694,14 +695,6 @@ def main(build_type): print 'retrying failed' return 1 - # Disable triggerring make_dep_graph. - # Code remained to enable it in the future - #data={} - #data['obs_project'] = project - #data['obs_linked_project'] = obs_target_prj - #data['action'] = "prerelease_build_progress" - #trigger_next('make_dep_graph', data) - elif build_type == 'snapshot': if not is_ref_deleted(gerrit_oldrev, gerrit_newrev): if build.exists(obs_target_prj):