Exemple #1
0
def install_dependencies():
    """
    Installs docker
    
    Reference: https://docs.docker.com/engine/installation/linux/docker-ce/debian/#install-docker-ce-1
    """
    with shared.suppress_stdout_stderr():
        installs = [
            "apt-transport-https", "ca-certificates", "curl",
            "software-properties-common"
        ]
        for item in installs:
            if (shared.is_installed(item)):
                pass
            else:
                shared.install_from_apt(item)

        # download key
        shared.download_from_http(
            "https://download.docker.com/linux/ubuntu/gpg")
        subprocess.call(["apt-key", "add", shared.INSTALL_DIR + "gpg"])

        # add to apt sources
        source_list = open("/etc/apt/sources.list.d/docker.list", "w")
        source_list.write(
            "deb [arch=amd64] https://download.docker.com/linux/debian wheezy stable\n"
        )
        source_list.close()

        #install docker
        subprocess.call(["apt-get", "update"])
        subprocess.call(["apt-get", "-y", "install", "docker-ce"])
Exemple #2
0
def test():

    if (os.path.exists("/etc/apt/sources.list.d/docker.list")):
        pass
    else:
        return "Docker not present in apt sources list."

    # are prereqs installed?
    installs = [
        "apt-transport-https", "ca-certificates", "curl",
        "software-properties-common", "docker-ce"
    ]
    for item in installs:
        if (shared.is_installed(item)):
            pass
        else:
            return "Package %s not installed" % item

    # is docker installed?
    proc = subprocess.Popen(["docker", "run", "hello-world"],
                            stdout=subprocess.PIPE)
    result = proc.stdout.read()
    if "Hello from Docker!" in result:
        pass
    else:
        return "Docker not installed."

    # is etherpad running on http://127.0.0.1:9001/ ?
    if (shared.get_http_status_code("localhost:9001") == 200):
        pass
    else:
        return "Etherpad docker image not installed."
Exemple #3
0
def test():
    if(os.path.exists("/etc/apt/sources.list.d/sublime-text.list")):
        pass
    else:
        return "Sublime text not present in apt sources list."

    # test if sublime-text and apt-transport-https is installed
    installs = ["sublime-text", "apt-transport-https"]
    for item in installs:
        if(shared.is_installed(item)):
            pass
        else:
            return "Package %s not installed" % item
Exemple #4
0
def install():
    for item in INSTALLS:
        if(shared.is_installed(item)):
            pass
        else:
            shared.install_from_apt(item)
Exemple #5
0
def test():
    for item in INSTALLS:
        if(shared.is_installed(item)):
            pass
        else:
            return "Package %s not installed" % item