Example #1
0
def main(dataset):
    containername = "kontact"

    if dataset == "john":
        setupConfigDirs("john", "*****@*****.**", "*****@*****.**",
                        "John Doe", "doe")
    if dataset == "jane":
        setupConfigDirs("jane", "*****@*****.**", "*****@*****.**",
                        "Jane Doe", "doe2")

    fdict = {"c": config, "dataset": dataset, "containername": containername}

    print("Building kontact...")
    docker.build(settings.dockerCacheString(),
                 "-t",
                 containername,
                 "{c.SCRIPT_DIR}/kontact/.".format(**fdict),
                 _out=sys.stdout)

    print("Building {dataset}'s kontact...".format(**fdict))
    docker.build(settings.dockerCacheString(),
                 "-t",
                 "{containername}:{dataset}".format(**fdict),
                 "-f",
                 "{c.SCRIPT_DIR}/kontact/Dockerfile-{dataset}".format(**fdict),
                 "{c.SCRIPT_DIR}/kontact/.".format(**fdict),
                 _out=sys.stdout)
Example #2
0
def main():
    containername="pep"
    dataset="default"

    fdict = {"c": config,
            "dataset": dataset,
            "containername": containername}

    print("Building pep...")
    docker.build(settings.dockerCacheString(), "-t", containername, "{c.SCRIPT_DIR}/pep/.".format(**fdict), _out=sys.stdout)

    print("Building {dataset}'s pep...".format(**fdict))
    docker.build(settings.dockerCacheString(), "-t", "{containername}:{dataset}".format(**fdict), "-f", "{c.SCRIPT_DIR}/pep/Dockerfile-{dataset}".format(**fdict), "{c.SCRIPT_DIR}/pep/.".format(**fdict), _out=sys.stdout)
Example #3
0
def main(buildenvironment):
    docker.build(
        settings.dockerCacheString(),
        "-t",
        "{buildenvironment}dev".format(buildenvironment=buildenvironment),
        "{}/buildenvironments/{buildenvironment}/".format(
            BASEPATH, buildenvironment=buildenvironment),
        _out=sys.stdout)
Example #4
0
def main():
    containername = "kolabclient/presice"

    print("Building kolabclient for Ubuntu 12.04...")
    docker.build(settings.dockerCacheString(),
                 "-t",
                 containername,
                 "{c.SCRIPT_DIR}/ubuntu/precise/.".format(c=config),
                 _out=sys.stdout)
Example #5
0
def main():
    containername = "kube"
    dataset = "default"

    fdict = {"c": config, "dataset": dataset, "containername": containername}

    print("Building kube...")
    docker.build(settings.dockerCacheString(),
                 "-t",
                 containername,
                 "{c.SCRIPT_DIR}/kube/.".format(**fdict),
                 _out=sys.stdout)

    print("Building {dataset}'s kube...".format(**fdict))
    docker.build(settings.dockerCacheString(),
                 "-t",
                 "{containername}:{dataset}".format(**fdict),
                 "-f",
                 "{c.SCRIPT_DIR}/kube/Dockerfile-{dataset}".format(**fdict),
                 "{c.SCRIPT_DIR}/kube/.".format(**fdict),
                 _out=sys.stdout)
Example #6
0
def main(dataset):
    tmpname="kolab/kolabtestcontainer:tmppopulated"
    imagename="kolab/kolabtestcontainer:populated-"+dataset
    basedir =  "{c.SCRIPT_DIR}/kolabpopulated".format(c=config)

    print("Building tmpcontainer...")
    docker.build(settings.dockerCacheString(), "-t", tmpname, "{basedir}/.".format(basedir=basedir))

    print("Starting tmpcontainer...")
    container = docker.run("-d", "-h", settings.HOSTNAME,
            "-v", "/sys/fs/cgroup:/sys/fs/cgroup:ro",
            "-v", "{basedir}/{dataset}/:/data/".format(basedir=basedir, dataset=dataset),
            '-v',  "{c.SCRIPT_DIR}/kolab/populate/:/populate".format(c=config),
            tmpname).rstrip()
    try:
        # Wait for imap to become available on imaps://localhost:993
        time.sleep(5)

        print "Populate OU..."
        docker("exec", container, "python2", "/populate/populate_ou.py", _out=sys.stdout)

        print "Populate users..."
        docker("exec", container, "python2", "/populate/populate_users.py", _out=sys.stdout)

        print "Populate resources..."
        docker("exec", container, "python2", "/populate/populate_resources.py", _out=sys.stdout)

        print("Running populate.sh...")
        docker("exec", container,  "/data/populate.sh", _out=sys.stdout)

        # Give kolabd some time to create all mailboxes
        time.sleep(5)

        docker("exec", container, "patch", "-R", "/etc/kolab/kolab.conf", "/data/kolab.conf.diff", _out=sys.stdout)
        docker("exec", container, "patch", "-R", "/etc/roundcubemail/calendar.inc.php", "/data/calendar.inc.php.diff", _out=sys.stdout)
        docker("exec", container, "patch", "-R", "/etc/roundcubemail/config.inc.php", "/data/config.inc.php.diff", _out=sys.stdout)
        docker("exec", container, "patch", "-R", "/etc/roundcubemail/kolab_addressbook.inc.php", "/data/kolab_addressbook.inc.php.diff", _out=sys.stdout)
        docker("exec", container, "patch", "-R", "/etc/roundcubemail/kolab_auth.inc.php", "/data/kolab_auth.inc.php.diff", _out=sys.stdout)
        docker("exec", container, "patch", "-R", "/etc/roundcubemail/password.inc.php", "/data/password.inc.php.diff", _out=sys.stdout)

        print("Comitting results to: {}".format(imagename))
        docker.commit(container, imagename)
    except:
        print("Unexpected error:", sys.exc_info()[0])
        traceback.print_exc(file=sys.stdout)
        print("Failed to setup container")

    docker.stop(container)
    docker.rm(container)
Example #7
0
def main(buildenvironment):
    docker.build(settings.dockerCacheString(), "-t", "{buildenvironment}dev".format(buildenvironment=buildenvironment), "{}/buildenvironments/{buildenvironment}/".format(BASEPATH, buildenvironment=buildenvironment), _out=sys.stdout)
Example #8
0
def main():
    containername="kolabclient/presice"

    print("Building kolabclient for Ubuntu 12.04...")
    docker.build(settings.dockerCacheString(), "-t", containername, "{c.SCRIPT_DIR}/ubuntu/precise/.".format(c=config), _out=sys.stdout)