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

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

    print("Building release docker...")
    docker.build("-t", containername, "{c.SCRIPT_DIR}/release/.".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(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 #4
0
def main(dataset):
    containername="kontact"

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

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

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

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

    SCRIPT_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))

    print("Building tmpcontainer...")
    docker.build("-t", tmpname, SCRIPT_DIR+"/kolabpopulated/.")
    print("Starting tmpcontainer...")
    container = docker.run("-d", "-h", settings.HOSTNAME, "-v", "/sys/fs/cgroup:/sys/fs/cgroup:ro", "-v", SCRIPT_DIR+"/kolabpopulated/"+dataset+"/:/data/", tmpname).rstrip()

    # Wait for imap to become available on imaps://localhost:993
    time.sleep(5)

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

    print("Comitting results...")
    docker.commit(container, imagename)
    docker.stop(container)
    docker.rm(container)
Example #6
0
def main():
    containername="kubestandalone"
    dataset="default"

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

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

    print("Building kube...".format(**fdict))
    docker.build("-t", "{containername}:kdesrcbuild".format(**fdict), "-f", "{c.SCRIPT_DIR}/kubestandalone/Dockerfile-kdesrcbuild".format(**fdict), "{c.SCRIPT_DIR}/kubestandalone/.".format(**fdict), _out=sys.stdout)

    print("Building {dataset}'s kubestandalone...".format(**fdict))
    docker.build("-t", "{containername}:{dataset}".format(**fdict), "-f", "{c.SCRIPT_DIR}/kubestandalone/Dockerfile-{dataset}".format(**fdict), "{c.SCRIPT_DIR}/kubestandalone/.".format(**fdict), _out=sys.stdout)
Example #7
0
def main():
    docker.build("-t", "fedora-kdedev", settings.SCRIPT_DIR+"/kdesrcbuild/", _out=sys.stdout)
Example #8
0
def main(buildenvironment):
    docker.build(settings.dockerCacheString(), "-t", "{buildenvironment}dev".format(buildenvironment=buildenvironment), "{}/buildenvironments/{buildenvironment}/".format(BASEPATH, buildenvironment=buildenvironment), _out=sys.stdout)
Example #9
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)