Esempio n. 1
0
def get_project(path):
    """
    get docker project given file path
    """
    logging.debug('get project ' + path)
    command = Command()
    config_path = get_yml_path(path)
    project = command.get_project(config_path)
    return project
Esempio n. 2
0
 def run(self): 
     """Run jobs
     """
     composed = self.compose_jobs()
     for job_name, compose_path in composed.iteritems():
         print "Running job {0} with compose {1}".format(job_name, compose_path)
         compose_cmd = ComposeCommand()
         project = compose_cmd.get_project(compose_path)
         print 'Building project {0}'.format(project.name)
         project.build()
         print 'Running compose project {0}'.format(project.name)
         project.up()
         print 'Project is_running status is {0}'.format(project.containers()[0].is_running)
     return project
Esempio n. 3
0
 def run(self):
     """Run jobs
     """
     composed = self.compose_jobs()
     for job_name, compose_path in composed.iteritems():
         print "Running job {0} with compose {1}".format(
             job_name, compose_path)
         compose_cmd = ComposeCommand()
         project = compose_cmd.get_project(compose_path)
         print 'Building project {0}'.format(project.name)
         project.build()
         print 'Running compose project {0}'.format(project.name)
         project.up()
         print 'Project is_running status is {0}'.format(
             project.containers()[0].is_running)
     return project
Esempio n. 4
0
def get_service_host(service_name):
    client = docker.Client()
    project = Command().get_project_name('replicationhandler')
    container = client.inspect_container("%s_%s_1" % (project, service_name))
    return container['NetworkSettings']['IPAddress']