コード例 #1
0
ファイル: testenv.py プロジェクト: mbohlender/docker
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
コード例 #2
0
ファイル: testenv.py プロジェクト: cmollekopf/docker
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
コード例 #3
0
ファイル: testenv.py プロジェクト: mbohlender/docker
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)
コード例 #4
0
ファイル: testenv.py プロジェクト: cmollekopf/docker
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)
コード例 #5
0
ファイル: run.py プロジェクト: cmollekopf/docker
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)
コード例 #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)
コード例 #7
0
ファイル: testenv.py プロジェクト: mbohlender/docker
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)
コード例 #8
0
ファイル: testenv.py プロジェクト: cmollekopf/docker
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)