Example #1
0
def server():
    parser = ArgumentParser(description="Debile master daemon")
    parser.add_argument("--config",
                        action="store",
                        dest="config",
                        default=None,
                        help="Path to the master.yaml config file.")
    parser.add_argument("-s",
                        "--syslog",
                        action="store_true",
                        dest="syslog",
                        help="Log to syslog instead of stderr.")
    parser.add_argument("-d",
                        "--debug",
                        action="store_true",
                        dest="debug",
                        help="Enable debug messages to stderr.")
    parser.add_argument("--auth",
                        action="store",
                        dest="auth_method",
                        default='ssl',
                        help="Auth method: 'ssl' or 'simple' (ip-based)")

    args = parser.parse_args()
    config = init_master(args.config)

    from debile.master.server import main
    main(args, config)
Example #2
0
def process_incoming():
    parser = ArgumentParser(description="Debile master incoming handling")
    parser.add_argument("--config",
                        action="store",
                        dest="config",
                        default=None,
                        help="Path to the master.yaml config file.")
    parser.add_argument(
        "--group",
        action="store",
        dest="group",
        default="default",
        help="Group to use for uploads without a X-Debile-Group field")
    parser.add_argument("--no-dud",
                        action="store_false",
                        dest="dud",
                        help="Do not process *.dud files.")
    parser.add_argument("--no-changes",
                        action="store_false",
                        dest="changes",
                        help="Do not process *.changes files.")
    parser.add_argument("directory",
                        action="store",
                        help="Directry to process.")

    args = parser.parse_args()
    config = init_master(args.config)

    from debile.master.incoming import main
    main(args, config)
def main():
    # init Apt, we need it later
    apt_pkg.init()

    parser = ArgumentParser(description="Debile Tanglu integration script")

    actions = parser.add_argument_group("Actions")
    actions.add_argument("--import",
                         action="store_true",
                         dest="import_pkgs",
                         help="Import new packages from Dak to Debile")
    actions.add_argument(
        "--unblock",
        action="store_true",
        dest="unblock_jobs",
        help="Run dose and unblock jobs that are now buildable")
    actions.add_argument("--prune",
                         action="store_true",
                         dest="prune_pkgs",
                         help="Prune packages no longer in Dak from Debile")
    actions.add_argument(
        "--reschedule",
        action="store_true",
        dest="reschedule_jobs",
        help="Reschedule jobs where debile is still waiting for an upload")
    actions.add_argument("--clean",
                         action="store_true",
                         dest="clean_results",
                         help="Remove unreferenced result directories")

    parser.add_argument("--config",
                        action="store",
                        dest="config",
                        default=None,
                        help="Path to the master.yaml config file.")
    parser.add_argument("suites",
                        action="store",
                        nargs='*',
                        help="Suites to process.")

    args = parser.parse_args()
    config = init_master(args.config)
    bridge = ArchiveDebileBridge(config)

    if args.import_pkgs:
        for suite in args.suites:
            bridge.import_pkgs(suite)
    if args.unblock_jobs:
        for suite in args.suites:
            bridge.unblock_jobs(suite)
    if args.prune_pkgs:
        for suite in args.suites:
            bridge.prune_pkgs(suite)
    if args.reschedule_jobs:
        bridge.reschedule_jobs()
    if args.clean_results:
        bridge.clean_results()
Example #4
0
def server():
    parser = ArgumentParser(description="Debile master daemon")
    parser.add_argument("--config", action="store", dest="config", default=None,
                        help="Path to the master.yaml config file.")
    parser.add_argument("-s", "--syslog", action="store_true", dest="syslog",
                        help="Log to syslog instead of stderr.")
    parser.add_argument("-d", "--debug", action="store_true", dest="debug",
                        help="Enable debug messages to stderr.")

    args = parser.parse_args()
    config = init_master(args.config)

    from debile.master.server import main
    main(args, config)
Example #5
0
def init():
    parser = ArgumentParser(description="Debile master database initialization")
    parser.add_argument("--config", action="store", dest="config", default=None,
                        help="Path to the master.yaml config file.")
    parser.add_argument("--force", action="store_true", dest="force", default=False,
                        help="Force initialization even if sanity checks fail.")
    parser.add_argument("file", action="store",
                        help="Yaml file with initial database.")

    args = parser.parse_args()
    config = init_master(args.config)

    from debile.master.dimport import main
    main(args, config)
def main():
    # init Apt, we need it later
    apt_pkg.init()

    parser = ArgumentParser(description="Debile Tanglu integration script")

    actions = parser.add_argument_group("Actions")
    actions.add_argument(
        "--import", action="store_true", dest="import_pkgs", help="Import new packages from Dak to Debile"
    )
    actions.add_argument(
        "--unblock", action="store_true", dest="unblock_jobs", help="Run dose and unblock jobs that are now buildable"
    )
    actions.add_argument(
        "--prune", action="store_true", dest="prune_pkgs", help="Prune packages no longer in Dak from Debile"
    )
    actions.add_argument(
        "--reschedule",
        action="store_true",
        dest="reschedule_jobs",
        help="Reschedule jobs where debile is still waiting for an upload",
    )
    actions.add_argument(
        "--clean", action="store_true", dest="clean_results", help="Remove unreferenced result directories"
    )

    parser.add_argument(
        "--config", action="store", dest="config", default=None, help="Path to the master.yaml config file."
    )
    parser.add_argument("suites", action="store", nargs="*", help="Suites to process.")

    args = parser.parse_args()
    config = init_master(args.config)
    bridge = ArchiveDebileBridge(config)

    if args.import_pkgs:
        for suite in args.suites:
            bridge.import_pkgs(suite)
    if args.unblock_jobs:
        for suite in args.suites:
            bridge.unblock_jobs(suite)
    if args.prune_pkgs:
        for suite in args.suites:
            bridge.prune_pkgs(suite)
    if args.reschedule_jobs:
        bridge.reschedule_jobs()
    if args.clean_results:
        bridge.clean_results()
Example #7
0
def process_incoming():
    parser = ArgumentParser(description="Debile master incoming handling")
    parser.add_argument("--config", action="store", dest="config", default=None,
                        help="Path to the master.yaml config file.")
    parser.add_argument("--group", action="store", dest="group", default="default",
                        help="Group to use for uploads without a X-Debile-Group field")
    parser.add_argument("--no-dud", action="store_false", dest="dud",
                        help="Do not process *.dud files.")
    parser.add_argument("--no-changes", action="store_false", dest="changes",
                        help="Do not process *.changes files.")
    parser.add_argument("directory", action="store",
                        help="Directry to process.")

    args = parser.parse_args()
    config = init_master(args.config)

    from debile.master.incoming import main
    main(args, config)
Example #8
0
def init():
    parser = ArgumentParser(
        description="Debile master database initialization")
    parser.add_argument("--config",
                        action="store",
                        dest="config",
                        default=None,
                        help="Path to the master.yaml config file.")
    parser.add_argument(
        "--force",
        action="store_true",
        dest="force",
        default=False,
        help="Force initialization even if sanity checks fail.")
    parser.add_argument("file",
                        action="store",
                        help="Yaml file with initial database.")

    args = parser.parse_args()
    config = init_master(args.config)

    from debile.master.dimport import main
    main(args, config)
Example #9
0
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

from flask import Flask
from debile.master.utils import init_master
from debileweb.blueprints.frontend import frontend

app = Flask("debile-web")
app.config.from_object('config')
app.register_blueprint(frontend)

if __name__ == '__main__':
    init_master(fedmsg=False)
    app.run(debug=False)
Example #10
0
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

from flask import Flask
from debile.master.utils import init_master
from debileweb.blueprints.frontend import frontend

app = Flask("debile-web")
app.config.from_object('config')
app.register_blueprint(frontend)


if __name__ == '__main__':
    init_master(fedmsg=False)
    app.run(debug=False)
Example #11
0
from debile.master.orm import Group
from debile.master.utils import init_master

config = init_master()
g = Group(name="foo")


def test_repo_info():
    c = config['repo']
    config['repo'] = {
        "repo_path": "/srv/debile/pool/{name}",
        "repo_url": "http://localhost/debile/pool/{name}",
        "files_path": "/srv/debile/files/{name}",
        "files_url": "http://localhost/debile/files/{name}",
    }
    assert g.get_repo_info() == {
        "repo_path": "/srv/debile/pool/foo",
        "repo_url": "http://localhost/debile/pool/foo",
        "files_path": "/srv/debile/files/foo",
        "files_url": "http://localhost/debile/files/foo",
    }
    config['repo'] = c


def fnord(group, conf):
    return {"foo": "bar"}


def test_repo_info():
    c = config['repo']
    config['repo'] = {
Example #12
0
from debile.master.orm import Group
from debile.master.utils import init_master

config = init_master(confpath='tests/resources/master.yaml')
g = Group(name="foo")


def test_repo_info():
    c = config['repo']
    config['repo'] = {
        "repo_path": "/srv/debile/pool/{name}",
        "repo_url": "http://localhost/debile/pool/{name}",
        "files_path": "/srv/debile/files/{name}",
        "files_url": "http://localhost/debile/files/{name}",
    }
    assert g.get_repo_info() == {
        "repo_path": "/srv/debile/pool/foo",
        "repo_url": "http://localhost/debile/pool/foo",
        "files_path": "/srv/debile/files/foo",
        "files_url": "http://localhost/debile/files/foo",
    }
    config['repo'] = c


def fnord(group, conf):
    return {"foo": "bar"}


def test_repo_info():
    c = config['repo']
    config['repo'] = {