From: Yonghee Han Date: Tue, 14 Feb 2017 08:47:54 +0000 (+0900) Subject: Use the OBS_package name on Staging OBS project X-Git-Tag: submit/trunk/20190927.012743~543 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89ec2c0d013e06b860db0c82a48df922dcb1344b;p=services%2Fjenkins-scripts.git Use the OBS_package name on Staging OBS project If a obs package has one spec file then there is use of OBS_package name in git-obs-mapping.xml ex) To use : If packaging directory contains multiply specfiles, use attribution OBS_package to specify the specfile name Change-Id: I95ec8c134d8e6c02f125f9edfdb157d2837977fe --- diff --git a/job_submitobs.py b/job_submitobs.py index 144193c..a915990 100755 --- a/job_submitobs.py +++ b/job_submitobs.py @@ -453,9 +453,15 @@ def main(): url = 'ssh://%s:%s' % (os.getenv('GERRIT_HOSTNAME'), os.getenv('GERRIT_SSHPORT')) gerrit_project = os.getenv('GERRIT_PROJECT') + # get package name from xml files. + if obs_pkg: + package = obs_pkg + else: + #get package name from spec file name. + package = spec.name # create local package - print '\nCheckout %s/%s to local' % (obs_stg_prj, spec.name) - localpkg = obspkg.ObsPackage(tmpdir, obs_stg_prj, spec.name, \ + print '\nCheckout %s/%s to local' % (obs_stg_prj, package) + localpkg = obspkg.ObsPackage(tmpdir, obs_stg_prj, package, \ apiurl, apiuser, apipasswd) commit_msg = 'Submitter: %s <%s>\nComments: %s\nGit project: '\ '%s\nTag: %s\nCommit: %s %s' % (tagger['author'], \ @@ -464,7 +470,7 @@ def main(): # upload _service to obs try: upload_obs_service(url, gerrit_project, tag, - event['newrev'], obs_stg_prj, build, spec.name) + event['newrev'], obs_stg_prj, build, package) except UploadError, err: print err return 1