2019-04-04 13:31:40 +02:00

57 lines
1.5 KiB
Python
Executable File

#!/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
import cmdln
from ttm.releaser import ToTestReleaser
from ttm.publisher import ToTestPublisher
logger = logging.getLogger()
class CommandLineInterface(ToolBase.CommandLineInterface):
def __init__(self, *args, **kwargs):
ToolBase.CommandLineInterface.__init__(self, args, kwargs)
@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
${cmd_usage}
${cmd_option_list}
"""
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
${cmd_usage}
${cmd_option_list}
"""
ToTestReleaser(self.tool).release(project, opts.force)
def do_run(self, subcmd, opts, project):
"""${cmd_name}: run the ToTest Manager
${cmd_usage}
${cmd_option_list}
"""
ToTestPublisher(self.tool).publish(project)
ToTestReleaser(self.tool).release(project)