Commit fd9b9e03 authored by Ernesto Rodriguez Ortiz's avatar Ernesto Rodriguez Ortiz
Browse files

Keep the task copy_public_ssh_keys.

We need this task to make fabric run tasks into the container.
parent e1e36cfb
......@@ -122,6 +122,7 @@ def image_create(role='local'):
if '{}/drupal'.format(env.project_name) in docker_images():
print(red('Docker image {}/drupal was found, you has already build this image'.format(env.project_name)))
else:
h._copy_public_ssh_keys(role)
h.fab_run(role, 'docker build -t {}/drupal .'.format(env.project_name))
print(green('Docker image {}/drupal was build successful'.format(env.project_name)))
......
......@@ -188,6 +188,18 @@ def hook_execute(hook, role='docker'):
with fab_cd(role, env.docker_site_root):
fab_run(role, cmd)
def _copy_public_ssh_keys(role='local'):
"""
Copy your public SSH keys to use it in the docker container to connect to it using ssh protocol.
:param role Default 'role' where to run the task
"""
set_env(role)
with fab_cd(role, WORKSPACE):
fab_run(role, 'cp ~/.ssh/id_rsa.pub conf/')
print(green('Public SSH key copied successful'))
def _update_profile(role='local'):
"""
Update or clone the installation profile specified in the configuration file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment