Commit fadd5d8c authored by Samuel Sirois's avatar Samuel Sirois
Browse files

Update drush_aliases creation to run inside container

parent c16aeb80
......@@ -74,15 +74,21 @@ def aliases():
drush_aliases = env.site_drush_aliases
workspace = env.workspace
if not h.fab_exists(role, drush_aliases):
h.fab_run(role, 'mkdir {}'.format(drush_aliases))
with h.fab_cd(role, drush_aliases):
# Create aliases
if h.fab_exists(role, '{}/aliases.drushrc.php'.format(drush_aliases)):
h.fab_run(role, 'rm {}/aliases.drushrc.php'.format(drush_aliases))
h.fab_run(role, 'cp {}/conf/aliases.drushrc.php .'.format(workspace))
print(green('Drush aliases have been copied to {} directory.'.format(drush_aliases)))
if not os.path.exists(drush_aliases):
dk_run(env.services['php'], user='root',
cmd='mkdir {}'.format(drush_aliases))
if os.path.exists('{}/aliases.drushrc.php'.format(drush_aliases)):
dk_run(env.services['php'], user='root',
cmd='rm {}/aliases.drushrc.php'.format(drush_aliases))
if os.path.exists('{}/conf/aliases.drushrc.php'.format(workspace)):
dk_run(env.services['php'], user='root',
cmd='cp {}/conf/aliases.drushrc.php {}/'.format(workspace,
drush_aliases))
print(green('Drush aliases have been copied to {} directory.'
''.format(drush_aliases)))
else:
print(green('Drush aliases have not been found'))
@task
......
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