Commit 8ee7032f authored by 20th (Victor Nikulshin)'s avatar 20th (Victor Nikulshin) Committed by Victor Nikulshin
Browse files

Replace `fab_run('local', …)` with direct `local()` calls

The `fab_run()` function does not add any behavior for local calls, only
ambiguity of the command execution environment.

Inlining `local()` calls contributes to a clear separation of enrivonments.
parent 669cfc07
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from datetime import datetime from datetime import datetime
from fabric.api import task, roles, env from fabric.api import task, roles, env, local
from fabric.colors import red, green from fabric.colors import red, green
from fabric.contrib.console import confirm from fabric.contrib.console import confirm
from fabric.utils import abort from fabric.utils import abort
...@@ -61,10 +61,10 @@ def make(action='install'): ...@@ -61,10 +61,10 @@ def make(action='install'):
drush_opts += " --working-copy --no-gitinfofile" drush_opts += " --working-copy --no-gitinfofile"
if not h.fab_exists('local', env.site_root): if not h.fab_exists('local', env.site_root):
h.fab_run('local', "mkdir {}".format(env.site_root)) local('mkdir {}'.format(env.site_root))
with h.fab_cd('local', env.site_root): with h.fab_cd('local', env.site_root):
h.fab_run('local', 'drush make {} {} -y'.format(drush_opts, env.makefile)) local('drush make {} {} -y').format(drush_opts, env.makefile))
@task @task
......
...@@ -191,7 +191,7 @@ def init_db(role='docker'): ...@@ -191,7 +191,7 @@ def init_db(role='docker'):
""" """
Create a database and a user that can access it. Create a database and a user that can access it.
""" """
container_ip = fab_run('local', 'docker inspect -f "{{{{.NetworkSettings.IPAddress}}}}" ' container_ip = local('docker inspect -f "{{{{.NetworkSettings.IPAddress}}}}" '
'{}_container'.format(env.project_name), capture=True) '{}_container'.format(env.project_name), capture=True)
docker_iface_ip = [(s.connect((container_ip, 80)), s.getsockname()[0], s.close()) docker_iface_ip = [(s.connect((container_ip, 80)), s.getsockname()[0], s.close())
......
from __future__ import unicode_literals from __future__ import unicode_literals
from fabric.api import task, roles, env from fabric.api import task, roles, env, local, lcd
from fabric.colors import green from fabric.colors import green
import helpers as h import helpers as h
...@@ -12,11 +12,10 @@ def build(): ...@@ -12,11 +12,10 @@ def build():
""" """
Generate the PatternLab static site Generate the PatternLab static site
""" """
role = 'local'
workspace = env.docker_workspace workspace = env.docker_workspace
host = env.site_hostname host = env.site_hostname
site_root = env.docker_site_root site_root = env.docker_site_root
with h.fab_cd(role, env.patternlab_dir): with lcd(env.patternlab_dir):
h.fab_run(role, 'touch public/styleguide/html/styleguide.html') local('touch public/styleguide/html/styleguide.html')
h.fab_run(role, 'php core/builder.php -g') local('php core/builder.php -g')
Supports Markdown
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