print repr(err)
print 'Updating Dashboard Failed'
-def start_build():
+def start_build(options):
""" Running build using Tizen Studio """
print 'ENTER start_build'
+ print options
+ option = 'normal'
+ if len(options) >= 1:
+ option = options[1]
+
sourceData, confData, ciData = make_data()
print '\n"Title": "%s/%s"\n' % (os.path.basename(sourceData.get('GIT_PATH')), \
(rs_ver, fail_title, fail_log, ts_version, ts_distribution)
statusCode = 'PASS'
+
if tizenStudioInst.build_result != 0 or fail_title != None:
statusCode = 'FAIL'
+ if option == 'check':
+ with open('abs_build_result_code.env', 'w') as output_return:
+ output_return.write(statusCode)
+ return
else:
+ if option == 'check':
+ with open('abs_build_result_code.env', 'w') as output_return:
+ output_return.write(statusCode)
+ return
+
if ciData.get('BUILD_CAUSE') == 'GIT':
postData = post_processing(tizenStudioInst, src_git, project_properties, \
sourceData, confData, ciData, builddir)
with open('abs_build_result_code.env', 'w') as output_return:
output_return.write(statusCode)
-def main():
+def main(options):
"""
Script entry point.
"""
- return start_build()
+ return start_build(options)
if __name__ == '__main__':
- sys.exit(main())
+ sys.exit(main(sys.argv))
return status
-def make_rs_snapshot_public(git_prj, git_cache, mygit, fields, profile, vm_image, specific_branch=None):
+def make_rs_snapshot_public(git_prj, git_cache, mygit, fields, profile, vm_image, \
+ specific_branch=None, specific_cmd=None):
"""
Make Rootstrap snapshot(public api)
"""
else:
git_branch = profile['git_branch']
+ if specific_cmd is not None:
+ cmd_to_use = specific_cmd
+ else:
+ cmd_to_use = profile['public_cmd']
+
print '\n\n==========='
print 'CREATING ROOTSTRAP FOR'
print ' [%s] [%s] [%s] [%s] [%s]' \
% (profile.get('project'), 'PUBLIC', \
- profile.get('git_branch'), profile.get('public_cmd'), git_branch)
+ profile.get('git_branch'), cmd_to_use, git_branch)
print '===========\n'
mygit.checkout(git_branch)
- rs = os.path.join(git_cache, git_prj, profile['public_cmd'])
+ rs = os.path.join(git_cache, git_prj, cmd_to_use)
if not os.path.isfile(rs):
print '%s is not found' % rs
return 'failed'
str_64_cmd = ''
if profile.get('support_64') != 'False':
str_64_cmd = '$WORKDIR/$SDKIMAGE/%s -u %s -b %s\n' % \
- (profile["public_cmd"].replace('.sh', '_64.sh'),
+ (cmd_to_use.replace('.sh', '_64.sh'),
os.path.join(profile["base_url"],profile["repo_path"],build_id),
os.path.join(profile["base_url"],profile["base_repo_path"],'latest'))
'%s\n' \
'cp -r $WORKDIR/$RS/ $BUILDDIR\n' % \
(git_cmd,
- profile["public_cmd"],
+ cmd_to_use,
os.path.join(profile["base_url"],profile["repo_path"],build_id),
os.path.join(profile["base_url"],profile["base_repo_path"],'latest'),
str_64_cmd)
status = 'succeeded'
reason = 'ok'
+
if profile.get('private_cmd', 'False') != 'False':
#### Make Rootstrap Snapshot (PRIVATE)####
status = make_rs_snapshot_private(git_prj, git_cache, mygit, fields, profile, vm_image)
#### Misc public rootstraps ####
if profile.get('misc_branches'):
for mb in profile.get('misc_branches'):
- status_1 = make_rs_snapshot_public(git_prj, git_cache, mygit, fields, profile, vm_image, specific_branch=mb)
+ status_1 = make_rs_snapshot_public(git_prj, git_cache, mygit, fields, profile, \
+ vm_image, specific_branch=mb)
if status_1 != 'succeeded':
status = status_1
+ if profile.get('public_misc_cmds'):
+ for mc in profile.get('public_misc_cmds'):
+ print 'MISC command: %s' % mc
+ make_rs_snapshot_public(git_prj, git_cache, mygit, fields, profile, \
+ vm_image, specific_cmd=mc)
if status == 'succeeded':
print "The RBS(Public) build was successful."
obs_stg_prj = item['OBS_staging_project']
obs_pkg = item['OBS_package']
obs_use_specname = item['OBS_use_specname']
+
+ if build_type == 'prerelease':
+ if obs_stg_prj == 'abs' and git_branch.endswith('_tpk'):
+ print 'Create ABS prerelease project...'
+ elif obs_stg_prj != 'prerelease':
+ print "%s is not 'prerelease' project in git-obs-mapping.xml." \
+ "It has been switched to submitobs workflow." \
+ "Skipping ..." % obs_stg_prj
+ continue
+
if 'config' in item and item['config'] is not None and item['config'].enable == 'false':
print 'SR for %s is not enabled' % (obs_target_prj)
continue
print 'package name = %s' %(package)
if build_type == 'prerelease':
- if obs_stg_prj == 'abs' and git_branch.endswith('_tpk'):
- print 'Create ABS prerelease project...'
- elif obs_stg_prj != 'prerelease':
- print "%s is not 'prerelease' project in git-obs-mapping.xml." \
- "It has been switched to submitobs workflow." \
- "Skipping ..." % obs_stg_prj
- continue
if not prerelease_enabled(backenddb, obs_target_prj):
print 'Skipping %s as prerelease is not enabled for it' % \
obs_target_prj