2019-03-26 07:51:53 +01:00
|
|
|
#!/usr/bin/python2
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
# (C) 2014 mhrusecky@suse.cz, openSUSE.org
|
|
|
|
# (C) 2014 tchvatal@suse.cz, openSUSE.org
|
|
|
|
# (C) 2014 aplanas@suse.de, openSUSE.org
|
|
|
|
# (C) 2014 coolo@suse.de, openSUSE.org
|
|
|
|
# (C) 2017 okurz@suse.de, openSUSE.org
|
|
|
|
# (C) 2018 dheidler@suse.de, openSUSE.org
|
|
|
|
# Distribute under GPLv2 or GPLv3
|
|
|
|
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
import logging
|
|
|
|
import ToolBase
|
2019-04-01 16:17:45 +02:00
|
|
|
import cmdln
|
2019-03-26 07:51:53 +01:00
|
|
|
|
2019-04-01 16:17:45 +02:00
|
|
|
from ttm.releaser import ToTestReleaser
|
|
|
|
from ttm.publisher import ToTestPublisher
|
2019-03-26 07:51:53 +01:00
|
|
|
|
|
|
|
logger = logging.getLogger()
|
|
|
|
|
|
|
|
class CommandLineInterface(ToolBase.CommandLineInterface):
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
ToolBase.CommandLineInterface.__init__(self, args, kwargs)
|
|
|
|
|
2019-04-01 16:17:45 +02:00
|
|
|
@cmdln.option('--force', action='store_true', help="Just release, don't check")
|
|
|
|
def do_publish(self, subcmd, opts, project):
|
|
|
|
"""${cmd_name}: check and publish ToTest
|
2019-03-26 07:51:53 +01:00
|
|
|
|
2019-04-01 16:17:45 +02:00
|
|
|
${cmd_usage}
|
|
|
|
${cmd_option_list}
|
|
|
|
"""
|
2019-03-26 07:51:53 +01:00
|
|
|
|
2019-04-01 16:17:45 +02:00
|
|
|
ToTestPublisher(self.tool).publish(project, opts.force)
|
|
|
|
|
|
|
|
@cmdln.option('--force', action='store_true', help="Just release, don't check")
|
|
|
|
def do_release(self, subcmd, opts, project):
|
|
|
|
"""${cmd_name}: check and release from project to ToTest
|
2019-03-26 07:51:53 +01:00
|
|
|
|
|
|
|
${cmd_usage}
|
|
|
|
${cmd_option_list}
|
|
|
|
"""
|
|
|
|
|
2019-04-01 16:17:45 +02:00
|
|
|
ToTestReleaser(self.tool).release(project, opts.force)
|
2019-03-26 07:51:53 +01:00
|
|
|
|
2019-04-01 16:17:45 +02:00
|
|
|
def do_run(self, subcmd, opts, project):
|
|
|
|
"""${cmd_name}: run the ToTest Manager
|
2019-03-26 07:51:53 +01:00
|
|
|
|
|
|
|
${cmd_usage}
|
|
|
|
${cmd_option_list}
|
|
|
|
"""
|
|
|
|
|
2019-04-01 16:17:45 +02:00
|
|
|
ToTestPublisher(self.tool).publish(project)
|
|
|
|
ToTestReleaser(self.tool).release(project)
|