return builder.root._attrs.values()[0]
def upload_obs_service(git_url, git_project, git_tag,
- git_revision, obs_project, build):
+ git_revision, obs_project, build, package):
"""UPload _service file to OBS.Create package if doesn't exist.To replace
make package in local"""
- package = os.path.basename(git_project)
if not build.exists(obs_project, package):
try:
build.create_package(obs_project, package)
(gerrit_prj, gerrit_branch))
def create_project(git_url, git_project, git_tag, git_revision, build,
- obs_target_prj, obs_project, submitter):
+ obs_target_prj, obs_project, submitter, package):
"""Create prerelease OBS project and upload sources for the build."""
# Create review project if it doesn't exist
try:
upload_obs_service(git_url, git_project, git_tag,
- git_revision, obs_project, build)
+ git_revision, obs_project, build, package)
except UtilsError, err:
raise LocalError(err)
for obs_target_prj, _obs_stg_prj, _obs_pkg in obs_target_prjs:
url = 'ssh://%s:%s' % (os.getenv('GERRIT_HOSTNAME'),
os.getenv('GERRIT_SSHPORT'))
+ # get package name from gerrit_project
+ package = os.path.basename(gerrit_project)
if build_type == 'prerelease':
if not prerelease_enabled(backenddb, obs_target_prj):
print 'Skipping %s as prerelease is not enabled for it' % \
if gerrit_account_email:
submitter += ' <%s>' % gerrit_account_email
create_project(url, gerrit_project, git_tag, gerrit_newrev,
- build, obs_target_prj, project, submitter)
+ build, obs_target_prj, project, submitter, package)
elif build_type == 'snapshot':
if not is_ref_deleted(gerrit_oldrev, gerrit_newrev):
if build.exists(obs_target_prj):
# Upload _service to target project
try:
upload_obs_service(url, gerrit_project, git_tag, \
- gerrit_newrev, obs_target_prj, build)
+ gerrit_newrev, obs_target_prj, build, package)
except UtilsError, err:
raise LocalError(err)
else: