"""
Make Rootstrap snapshot(private api)
"""
+
# checkout branch
git_branch = profile['git_branch']
+
+ print '\n\n==========='
+ print 'CREATING ROOTSTRAP FOR'
+ print ' [%s] [%s] [%s] [%s] [%s]' \
+ % (profile.get('project'), 'PRIVATE', \
+ profile.get('git_branch'), profile.get('private_cmd'), git_branch)
+ print '===========\n'
+
mygit.checkout(git_branch)
- rs = os.path.join(git_cache, git_prj, 'make_'+profile['private_cmd']+'.sh')
+ rs = os.path.join(git_cache, git_prj, profile['private_cmd'])
if not os.path.isfile(rs):
print '%s is not found' % rs
return 'failed'
# 64 bit support
str_64_cmd = ''
if profile.get('support_64') != 'False':
- str_64_cmd = '$WORKDIR/$SDKIMAGE/make_%s_64.sh -u %s -b %s\n' % \
- (profile["private_cmd"],
+ str_64_cmd = '$WORKDIR/$SDKIMAGE/%s -u %s -b %s\n' % \
+ (profile["private_cmd"].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'))
'chown -R build:build $BUILDDIR\nchmod 600 $BUILDDIR/.ssh/id_rsa \n' \
'cp -r "$BUILDDIR/.ssh/" /root/\nchmod 600 /root/.ssh/id_rsa\n' \
'mkdir -p "$WORKDIR"\ncd "$WORKDIR"\n%s\n' \
- '$WORKDIR/$SDKIMAGE/make_%s.sh -u %s -b %s\n' \
+ '$WORKDIR/$SDKIMAGE/%s -u %s -b %s\n' \
'%s\n' \
'cp -r $WORKDIR/$RS/ $BUILDDIR\n' % \
(git_cmd,
git_branch = specific_branch
else:
git_branch = profile['git_branch']
+
+ 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)
+ print '===========\n'
+
mygit.checkout(git_branch)
- rs = os.path.join(git_cache, git_prj, 'make_'+profile['public_cmd']+'.sh')
+ rs = os.path.join(git_cache, git_prj, profile['public_cmd'])
if not os.path.isfile(rs):
print '%s is not found' % rs
return 'failed'
# 64 bit support
str_64_cmd = ''
if profile.get('support_64') != 'False':
- str_64_cmd = '$WORKDIR/$SDKIMAGE/make_%s_64.sh -u %s -b %s\n' % \
- (profile["public_cmd"],
+ str_64_cmd = '$WORKDIR/$SDKIMAGE/%s -u %s -b %s\n' % \
+ (profile["public_cmd"].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'))
'chown -R build:build $BUILDDIR\nchmod 600 $BUILDDIR/.ssh/id_rsa \n' \
'cp -r "$BUILDDIR/.ssh/" /root/\nchmod 600 /root/.ssh/id_rsa\n' \
'mkdir -p "$WORKDIR"\ncd "$WORKDIR"\n%s\n' \
- '$WORKDIR/$SDKIMAGE/make_%s.sh -u %s -b %s\n' \
+ '$WORKDIR/$SDKIMAGE/%s -u %s -b %s\n' \
'%s\n' \
'cp -r $WORKDIR/$RS/ $BUILDDIR\n' % \
(git_cmd,
status = 'succeeded'
reason = 'ok'
- #### Make Rootstrap Snapshot (PRIVATE)####
- status = make_rs_snapshot_private(git_prj, git_cache, mygit, fields, profile, vm_image)
-
- if status == 'succeeded':
- print "The RBS(Internal) build was successful."
- else:
- print "The RBS(Internal) build was failed."
- reason = 'RBS build fail'
-
- try:
- update_dashboard(fields['project'], \
- fields['build_id'].split('_')[-1],
- status, reason,
- fields.get('infra', 'LOCAL')
- )
- except Exception as err:
- print repr(err)
+ 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)
+
+ if status == 'succeeded':
+ print "The RBS(Internal) build was successful."
+ else:
+ print "The RBS(Internal) build was failed."
+ reason = 'RBS build fail'
+
+ try:
+ update_dashboard(fields['project'], \
+ fields['build_id'].split('_')[-1],
+ status, reason,
+ fields.get('infra', 'LOCAL')
+ )
+ except Exception as err:
+ print repr(err)
status = 'succeeded'
#### Make Rootstrap Snapshot (PUBLIC)####