from common.workflow import find_specfile, parse_specfile
from common.tizen_studio import TizenStudio
+
# set default char-set endcoding to utf-8
reload(sys)
sys.setdefaultencoding('utf-8') # pylint: disable-msg=E1101
spec = generate_spec_file(tizen_studio, src_git, prop, data)
print 'SPEC:\n%s' % spec
+ gerrit_env = get_gerrit_infra(data.get('gerrit_infra', 'LOCAL'))
+ remote = 'ssh://%s@%s:%d/%s' % (gerrit_env.get('username'), \
+ gerrit_env.get('hostname'), \
+ gerrit_env.get('sshport'), \
+ data.get('project'))
+
#TODO: Checkout _tpk branch and push the tpks and tag it
new_branch = data.get('new_branch')
new_tag = data.get('new_tag')
print 'Checking tag [%s]' % chk_tag
if chk_tag:
print 'Tag(%s) already exist.' % new_tag
- mailer.add_title('The same tag exist')
- mailer.add_message('Result: FAIL')
- mailer.add_message('\n\nTag %s already exist.' % new_tag)
- return
- except:
+ #TODO: Force remove previous tag...
+ if True:
+ src_git.delete_tag(new_tag)
+ src_git.remove_tag_from_remote(remote, new_tag)
+ else:
+ mailer.add_title('The same tag exist')
+ mailer.add_message('Result: FAIL')
+ mailer.add_message('\n\nTag %s already exist.' % new_tag)
+ return
+ except Exception as err:
+ print repr(err)
pass
try:
src_git.remove_files('*')
mailer.add_message('\n\nGit push branch %s failed %s' % (new_branch, push_err_msg))
return
- gerrit_env = get_gerrit_infra(data.get('gerrit_infra', 'LOCAL'))
- remote = 'ssh://%s@%s:%d/%s' % (gerrit_env.get('username'), \
- gerrit_env.get('hostname'), \
- gerrit_env.get('sshport'), \
- data.get('project'))
-
message = '%s\n' \
'[ABS] Ready.\n' \
'- Original Tag: %s (%s)\n' \
project_properties = retrieve_project_property(src_git, int_tag)
- #FIXME:
+ #FIXME:
if project_properties.get('sdk_profile') == "" or project_properties.get('sdk_profile') is None:
if "mobile" in data.get('project'):
project_properties['sdk_profile'] = "mobile"
# Make tarball to share source codes easily with vm machine
zipping_workspace(src_root)
- parallel_jobs = ''
+ parallel_jobs = '"-j 1"'
#if data.get('buildcheck'):
# parallel_jobs = '"-j 4"'
#### Running QEMU to launch Tizen Studio ####
mailer.send_mail()
#TODO: DASHBOARD
update_dashboard(int_tag, data, project_properties, \
- status='failed', status_reason=fail_log[len(fail_log)-1024:], \
+ status='failed', status_reason=fail_log, \
rootstrap_version=rs_ver.strip(), \
tizen_studio_version=ts_version, \
tizen_studio_distribution=ts_distribution)
if 'FAIL' in mailer.email_title:
#TODO: DASHBOARD
update_dashboard(int_tag, data, project_properties, \
- status='failed', status_reason=fail_log[len(fail_log)-1024:], \
+ status='failed', status_reason=fail_log, \
rootstrap_version=rs_ver.strip(), \
tizen_studio_version=ts_version, \
tizen_studio_distribution=ts_distribution)
else:
return (br in self.get_branches()[1])
+ def remove_tag_from_remote(self, remote, tag):
+ """Remove tag from the remote
+ @param remote: complete url
+ """
+
+ args = GitArgs(remote, ':' + tag)
+ self._git_command("push", args.args)
+
def _update_gitproject(localdir, gitpath=None):
"""Fetch latest code to local dir"""
if not gerrit_hostname or not gerrit_username or not gerrit_sshport:
giturl = 'ssh://%s@%s:%s' % (os.getenv('GERRIT_USERNAME'),
os.getenv('GERRIT_HOSTNAME'),
- os.getenv('GERRIT_SSHPORT'))
+ os.getenv('GERRIT_SSHPORT'))
else:
giturl = 'ssh://%s@%s:%s' % (gerrit_username,gerrit_hostname,gerrit_sshport)
if not giturl:
if not gerrit_hostname or not gerrit_username or not gerrit_sshport:
giturl = 'ssh://%s@%s:%s/%s' % (os.getenv('GERRIT_USERNAME'),
- os.getenv('GERRIT_HOSTNAME'),
+ os.getenv('GERRIT_HOSTNAME'),
os.getenv('GERRIT_SSHPORT'),
- gerritprj)
+ gerritprj)
else:
giturl = 'ssh://%s@%s:%s' % (gerrit_username,gerrit_hostname,gerrit_sshport,gerritprj)