# get 'name' and 'version' from spec file
name = utils.parse_spec(specfile, 'name')
version = utils.parse_spec(specfile, 'version')
- src_prj = 'Trunk'
- target_prj = "home:%s:branches:gbs:%s" % (USER, src_prj)
+
+ if opts.base_obsprj is None:
+ # TODO, get current branch of git to determine it
+ base_prj = 'Trunk'
+ else:
+ base_prj = opts.base_obsprj
+
+ if opts.target_obsprj is None:
+ target_prj = "home:%s:gbs:%s" % (USER, base_prj)
+ else:
+ target_prj = opts.target_obsprj
+
prj = obspkg.ObsProject(target_prj, apiurl = SRCSERVER, oscrc = oscrcpath)
+ msger.info('checking status of obs project: %s ...' % target_prj)
if prj.is_new():
- msger.info('creating home project for package build ...')
- prj.branch_from(src_prj)
+ msger.info('creating %s for package build ...' % target_prj)
+ prj.branch_from(base_prj)
- msger.info('checking out project ...')
+ msger.info('checking out %s/%s to %s ...' % (target_prj, name, tmpdir))
localpkg = obspkg.ObsPackage(tmpdir, target_prj, name, SRCSERVER, oscrcpath)
workdir = localpkg.get_workdir()
localpkg.remove_all()
os.unlink(oscrcpath)
msger.info('local changes submitted to build server successfully')
+ msger.info('follow the link to monitor the build progress: ')
+ msger.info('%s/project/show?project=%s' % (SRCSERVER.replace('api', 'build'), target_prj))
msger.set_loglevel('debug')
@cmdln.alias("bl")
- @cmdln.option('-p', '--obsprj', default='',
- help='The corresponding project name in remote OBS server. ' \
- 'If not specified, "home:<userid>:branches:Trunk" will' \
- ' be used.')
+ @cmdln.option('-T', '--target-obsprj', default=None, dest='target_obsprj',
+ help='The corresponding OBS target project used to build package, '\
+ 'If not specified, "home:<userid>:gbs:Trunk" will be used.')
+ @cmdln.option('-B', '--base-obsprj', default=None, dest='base_obsprj',
+ help='The corresponding OBS Base project used to branch from, ' \
+ 'If not specified, "Trunk" will be used.')
@_fall_to_shell('build')
def do_build(self, subcmd, opts, *args):
"""${cmd_name}: test building for current pkg