Exemplo n.º 1
0
def main():
    facts = get_facts()

    if not docker.DockerService.is_running():
        docker.DockerService.start()

    try:
        docker.DockerfileBuilder() \
            .with_template(os.path.join(facts['project']['path'], 'docker', 'Dockerfile.tpl')) \
            .with_vars(facts['user']) \
            .with_output(os.path.join(facts['project']['path'], 'docker', 'Dockerfile')) \
            .build()

        docker.Docker().build(path=os.path.join(facts['project']['path'], 'docker'), tag='arwmar/base:devel')
    finally:
        if os.path.exists('Dockerfile'):
           os.unlink('Dockerfile')
Exemplo n.º 2
0
def main():
    facts = get_facts()

    if not DockerService.is_running():
        DockerService.start()

    if not os.path.exists(facts['project']['docker_workspace_path']):
        os.mkdir(facts['project']['docker_workspace_path'])

    print "FIXME: disabling x access control"
    os.system('xhost +')

    DockerContainerBuilder() \
        .with_image('arwmar/base:devel') \
        .with_volume(host_path = facts['project']['path'], docker_path = '/opt/sources/base') \
        .with_volume(host_path = facts['x']['socket_dir'], docker_path = facts['x']['socket_dir']) \
        .with_volume(host_path = facts['project']['docker_workspace_path'], docker_path = os.path.join(facts['user']['home_dir'], facts['user']['login'])) \
        .with_env(name = 'DISPLAY', value = facts['x']['display']) \
        .with_tty() \
        .with_interactive() \
        .run()
Exemplo n.º 3
0
def index():
    queryfacts = request.args.get('facts')
    if request.args.get('json'):
        return Response(response=get_facts(puppetdb, queryfacts, puppetdbapi), mimetype="application/json")
    else:
        return render_template('index.html', facts=json.loads(get_facts(puppetdb, queryfacts, puppetdbapi)))