Exemple #1
0
def startContainer(name, runner):
    container = dockerutils.findContainer(name)
    if not container:
        runner()
        container = dockerutils.findContainer(name)
    print("Container is ready: {} {}".format(name, container))
    return container
Exemple #2
0
def startContainer(name, runner):
    container = dockerutils.findContainer(name)
    if not container:
        runner()
        container = dockerutils.findContainer(name)
    print("Container is ready: {} {}".format(name, container))
    return container
Exemple #3
0
def start(options):
    dataset = options.dataset
    clientconfigset = options.clientconfigset
    standalone = clientconfigset is None
    if standalone:
        print("start " + dataset + " in background")
    else:
        print("start " + dataset + " " + clientconfigset)

    container = None
    started = False
    if dataset:
        cname = "{}:{}".format(settings.REPOSITORY,
                               settings.populatedTag(dataset))
        started = dockerutils.findContainer(cname) == ""
        container = startContainer(
            cname, lambda: kolabpopulated.run.main(dataset, standalone))
    if clientconfigset == "pep":
        pep.run.main()
    elif clientconfigset == "kube":
        kube.run.main(container)
    elif clientconfigset == "release":
        release.run.main()
    elif clientconfigset == "kubestandalone":
        kubestandalone.run.main()
    elif not standalone:
        kontact.run.main(container, clientconfigset)
        if started:
            sh.docker.kill(container)
            sh.docker.rm(container)
Exemple #4
0
def start(options):
    dataset = options.dataset
    clientconfigset = options.clientconfigset
    standalone = clientconfigset is None
    if standalone:
        print("start " + dataset + " in background")
    else:
        print("start " + dataset + " " + clientconfigset)

    container = None
    started = False
    if dataset:
        cname = "{}:{}".format(settings.REPOSITORY, settings.populatedTag(dataset))
        started = dockerutils.findContainer(cname) == ""
        container = startContainer(cname, lambda: kolabpopulated.run.main(dataset, standalone))
    if clientconfigset == "pep":
        pep.run.main()
    elif clientconfigset == "kube":
        kube.run.main(container)
    elif clientconfigset == "release":
        release.run.main()
    elif not standalone:
        kontact.run.main(container, clientconfigset)
        if started:
            sh.docker.kill(container)
            sh.docker.rm(container)
Exemple #5
0
def main(x11forward, server):
    kolabcontainer = dockerutils.findContainer(server)

    runargs = [ "-ti",
        "--rm",
        "--privileged",
        "--link", "{}:kolab".format(kolabcontainer),
        "-v", "~/kdebuild/automatedupdate:/work",
	"-v", "{}/bashrc:/home/developer/.bashrc".format(BASEPATH),
    ]
    if x11forward:
	    x11 = X11Support()
	    x11.setupX11Authorization()
	    runargs.extend(x11.docker_args())
    image="kolabclient/presice"
    runargs.append(image)
    runargs.extend(["-c","bash"])
    args = ["docker","run"]
    args.extend(runargs)
    subprocess.call(" ".join(args), shell=True, cwd=settings.SCRIPT_DIR)
Exemple #6
0
def main(x11forward, server):
    kolabcontainer = dockerutils.findContainer(server)

    runargs = [
        "-ti",
        "--rm",
        "--privileged",
        "--link",
        "{}:kolab".format(kolabcontainer),
        "-v",
        "~/kdebuild/automatedupdate:/work",
        "-v",
        "{}/bashrc:/home/developer/.bashrc".format(BASEPATH),
    ]
    if x11forward:
        x11 = X11Support()
        x11.setupX11Authorization()
        runargs.extend(x11.docker_args())
    image = "kolabclient/presice"
    runargs.append(image)
    runargs.extend(["-c", "bash"])
    args = ["docker", "run"]
    args.extend(runargs)
    subprocess.call(" ".join(args), shell=True, cwd=settings.SCRIPT_DIR)
Exemple #7
0
def shell(options):
    print "shell " + options.dataset
    container = dockerutils.findContainer("{}:{}".format(
        settings.REPOSITORY, settings.populatedTag(options.dataset)))
    subprocess.call("docker exec -i -t {} bash".format(container), shell=True)
Exemple #8
0
def shell(options):
    print "shell " + options.dataset
    container = dockerutils.findContainer("{}:{}".format(settings.REPOSITORY, settings.populatedTag(options.dataset)))
    subprocess.call("docker exec -i -t {} bash".format(container), shell=True)