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

Set interative_mode to True by default in a different way.

If env.interactive_mode is set in the env file we can not override the value
usin --set, so is we asume that interactive is True by default and if
interactive_mode='false' we pass to non interactive.
parent e1d07e16
......@@ -32,7 +32,7 @@ Those are global project parameters mandatory to Drupalizer.
|Project root directory.
|_interactive_mode_
|If False, no prompt. Useful for Jenkins.
|If false, no prompt. Useful for Jenkins.
|_locale_
|If True, install the site in French.
......
......@@ -7,7 +7,6 @@ from fabric.api import env
env.project_name = ''
env.workspace = path.join(path.dirname(__file__), path.pardir)
env.interactive_mode = True
env.locale = False
......
......@@ -141,7 +141,7 @@ def container_start(role='local'):
# If container was successful build, get the IP address and show it to the user.
env.container_ip = h.fab_run(role, 'docker inspect -f "{{{{.NetworkSettings.IPAddress}}}}" '
'{}_container'.format(env.project_name), capture=True)
if env.interactive_mode:
if env.get('interactive_mode', True) != 'false':
h.fab_update_hosts(env.container_ip, env.site_hostname)
print(green('Docker container {}_container was build successful. '
......@@ -165,7 +165,7 @@ def container_stop(role='local'):
"""
with h.fab_cd(role, env.workspace):
if '{}_container'.format(env.project_name) in docker_ps():
if env.interactive_mode:
if env.get('interactive_mode', True) != 'false':
h.fab_remove_from_hosts(env.site_hostname)
h.fab_run(role, 'docker stop {}_container'.format(env.project_name))
print(green('Docker container {}_container was successful stopped'.format(env.project_name)))
......@@ -183,7 +183,7 @@ def container_remove(role='local'):
with h.fab_cd(role, env.workspace):
if '{}_container'.format(env.project_name) in docker_ps():
if env.interactive_mode:
if env.get('interactive_mode', True) != 'false':
h.fab_remove_from_hosts(env.site_hostname)
h.fab_run(role, 'docker rm -f {}_container'.format(env.project_name))
......
......@@ -44,13 +44,13 @@ def make(action='install'):
drush_opts += "--contrib-destination=profiles/{} ".format(env.site_profile)
h.update_profile()
if not env.interactive_mode:
if env.get('interactive_mode', True) == 'false':
drush_opts += "--translations=fr "
elif confirm(red('Say [Y] to {} the site at {} with the French translation, if you say [n] '
'the site will be installed in English only'.format(action, env.site_root))):
drush_opts += "--translations=fr "
if env.interactive_mode:
if env.get('interactive_mode', True) != 'false':
drush_opts += " --working-copy --no-gitinfofile"
if not h.fab_exists('local', env.site_root):
h.fab_run('local', "mkdir {}".format(env.site_root))
......
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