|
Lines 389-398
class MultiDocker(Docker):
Link Here
|
| 389 |
return |
389 |
return |
| 390 |
|
390 |
|
| 391 |
def pull(self): |
391 |
def pull(self): |
| 392 |
mkdir(self.app.get_compose_dir()) |
392 |
self._setup_yml(recreate=True) |
| 393 |
yml_file = self.app.get_compose_file('docker-compose.yml') |
|
|
| 394 |
shutil.copy2(self.app.get_cache_file('compose'), yml_file) |
| 395 |
os.chmod(yml_file, 0600) |
| 396 |
self.logger.info('Downloading app images') |
393 |
self.logger.info('Downloading app images') |
| 397 |
ret, out = call_process2(['docker-compose', '-p', self.app.id, 'pull'], cwd=self.app.get_compose_dir(), logger=_logger) |
394 |
ret, out = call_process2(['docker-compose', '-p', self.app.id, 'pull'], cwd=self.app.get_compose_dir(), logger=_logger) |
| 398 |
if ret != 0: |
395 |
if ret != 0: |
|
Lines 422-432
class MultiDocker(Docker):
Link Here
|
| 422 |
template_file = '%s.template' % yml_file |
419 |
template_file = '%s.template' % yml_file |
| 423 |
mkdir(self.app.get_compose_dir()) |
420 |
mkdir(self.app.get_compose_dir()) |
| 424 |
shutil.copy2(self.app.get_cache_file('compose'), template_file) |
421 |
shutil.copy2(self.app.get_cache_file('compose'), template_file) |
| 425 |
os.chmod(yml_file, 0600) |
|
|
| 426 |
with open(template_file) as fd: |
422 |
with open(template_file) as fd: |
| 427 |
template = fd.read() |
423 |
template = fd.read() |
| 428 |
content = ucr_run_filter(template) |
424 |
content = ucr_run_filter(template) |
| 429 |
with open(yml_file, 'wb') as fd: |
425 |
with open(yml_file, 'wb') as fd: |
|
|
426 |
os.chmod(yml_file, 0600) |
| 430 |
fd.write(content) |
427 |
fd.write(content) |
| 431 |
content = yaml.load(open(yml_file), yaml.RoundTripLoader, preserve_quotes=True) |
428 |
content = yaml.load(open(yml_file), yaml.RoundTripLoader, preserve_quotes=True) |
| 432 |
container_def = content['services'][self.app.docker_main_service] |
429 |
container_def = content['services'][self.app.docker_main_service] |