Skip to content

Commit

Permalink
docker_helper: removing unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cenouralm authored and fenekku committed Sep 8, 2020
1 parent d6dae91 commit aab5706
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions invenio_cli/helpers/docker_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,6 @@ def __init__(self, project_shortname, local=True, log_config=None):
logging.basicConfig(filename=self.log_config.logfile,
level=logging.INFO)

def build_image(self, dockerfile, tag):
"""Build docker image."""
self.docker_client.images.build(path=os.getcwd(),
dockerfile=dockerfile, tag=tag)

def create_images(self):
"""Create images according to the specified environment."""
# Open logging pipe
logpipe = LogPipe(self.log_config)

command = ['docker-compose',
'--file', 'docker-compose.full.yml', 'up', '--no-start']
if self.local:
command[2] = 'docker-compose.yml'

subprocess.call(command, stdout=logpipe, stderr=logpipe)
# Close logging pipe
logpipe.close()

def start_containers(self):
"""Start containers according to the specified environment."""
command = [
Expand Down Expand Up @@ -112,19 +93,6 @@ def _normalize_name(self, project_shortname):
else:
return project_shortname

def copy(self, src_file, dst_path, project_shortname):
"""Copy a file into the path of the specified container."""
container_name = '{}_web-ui_1'.format(
self._normalize_name(project_shortname))
container = self.docker_client.containers.get(container_name)

with tarfile.open('tmp.tar', "w") as tar:
tar.add(src_file, arcname=os.path.basename(src_file),
recursive=False)
with open('tmp.tar', 'rb') as fin:
data = io.BytesIO(fin.read())
container.put_archive(dst_path, data)

def copy2(self, src_path, dst_path):
"""Copy a file into the path of the specified container."""
container_name = '{}_web-ui_1'.format(self.container_prefix)
Expand Down

0 comments on commit aab5706

Please sign in to comment.