else:
self.package = package
- def remote_build(self, dest_project, git_project, message = ''):
+ def remote_build(self, dest_project, git_project, spec, packagingdir, message = ''):
""" Use gbs remotebuild to send local git tree to OBS as obs package """
if not self.bs.getTargets(dest_project):
print '\n----------\nOBS %s project do not have repo setting, quit build check against to it\n----------' % dest_project
return 'NoRepo'
with open('%s/packaging/git_info' % git_project, 'w') as fh:
fh.write(message)
- print "Call gbs command: ", "gbs -v rb --include-all -B %s -T %s %s" %(dest_project, self.project, git_project)
- runner.show("gbs -v rb --include-all -B %s -T %s %s" %(dest_project, self.project, git_project))
+ runner.show("gbs -v rb --include-all -B %s -T %s --spec %s --packaging-dir %s %s" %(dest_project, self.project, spec, packagingdir, git_project))
os.remove("%s/packaging/git_info" % git_project)
def wait_build_finish(self):
# submit this change to OBS for build check
print 'submit this change to OBS for build check...'
temp_build = TempPackageBuild(OBS_API_URL, OBS_OSCRC_PATH, buildcheck_project, spec.name)
- if 'NoRepo' == temp_build.remote_build(obs_dest_prj, prjdir, 'GIT_PROJECT: %s\nCOMMIT_ID: %s\nOWNER_EMAIL: %s' % (GERRIT_PROJECT, GERRIT_PATCHSET_REVISION, GERRIT_CHANGE_OWNER_EMAIL)):
+ if 'NoRepo' == temp_build.remote_build(obs_dest_prj, prjdir, os.path.basename(specfile), packagingdir, 'GIT_PROJECT: %s\nCOMMIT_ID: %s\nOWNER_EMAIL: %s' % (GERRIT_PROJECT, GERRIT_PATCHSET_REVISION, GERRIT_CHANGE_OWNER_EMAIL)):
msg = "[BUILD CHECK RESULT] Can not test build against to project %s, which currently has no build targets defined. Please contact the build system administrator." %(obs_dest_prj)
mygerrit.review(commit = GERRIT_PATCHSET_REVISION, message = msg)
except Exception, err:
# use gbs export to generate tarball
outdir = tempfile.mkdtemp(prefix=tmpdir+'/')
with utils.Workdir(prjdir):
- runner.show('gbs export --spec=%s -o %s' % (specfile, outdir))
+ runner.show('gbs export --spec %s --packaging-dir %s -o %s' % (os.path.basename(specfile), packagingdir, outdir))
except Exception, exc:
print('gbp parse spec failed. %s' % exc)
msg = "The tag %s pushed, but backend service parsed %s failed. Please make sure (gbs export) can work in this project." % (tag, os.path.basename(specfile))