Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Drupal
drupalizer
Commits
3478d904
Commit
3478d904
authored
Dec 20, 2016
by
Ernesto Rodriguez Ortiz
Browse files
Fix bug: dont crash if the drush aliases don't exists.
Add support for the config_installer profile
parent
ad1ddc7d
Pipeline
#2040
passed with stages
in 1 minute and 56 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core.py
View file @
3478d904
...
...
@@ -129,13 +129,14 @@ def hook_execute(cmds=env.hook_post_install, service=env.services['php']):
dk_run
(
service
,
cmd
=
cmd
)
def
is_c
ore
_profile
(
profile_name
):
def
is_c
ustom
_profile
(
profile_name
):
"""
Helper function to check if the profile is a core profile
:param profile_name:
:return:
"""
return
profile_name
in
(
'minimal'
,
'standard'
,
'testing'
)
return
profile_name
not
in
(
'minimal'
,
'standard'
,
'testing'
,
'config_installer'
)
def
remove_from_hosts
(
hostname
):
...
...
drush.py
View file @
3478d904
...
...
@@ -42,7 +42,7 @@ def make(action='install'):
drush_opts
=
"--prepare-install "
if
action
!=
'update'
else
''
# Update profile codebase
if
env
.
site_profile
and
not
is_core
_profile
(
env
.
site_profile
):
if
env
.
site_profile
_repo
and
is_custom
_profile
(
env
.
site_profile
):
update_profile
()
if
env
.
site_languages
:
...
...
@@ -80,11 +80,13 @@ def aliases():
if
os
.
path
.
exists
(
'{}/aliases.drushrc.php'
.
format
(
drush_aliases
)):
local
(
'rm {}/aliases.drushrc.php'
.
format
(
drush_aliases
))
local
(
'cp {}/conf/aliases.drushrc.php {}/'
.
format
(
workspace
,
drush_aliases
))
print
(
green
(
'Drush aliases have been copied to {} directory.'
''
.
format
(
drush_aliases
)))
if
os
.
path
.
exists
(
'{}/conf/aliases.drushrc.php'
.
format
(
workspace
)):
local
(
'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
def
updatedb
():
...
...
@@ -113,10 +115,14 @@ def site_install():
site_admin_pass
=
env
.
site_admin_pass
site_subdir
=
env
.
site_subdir
profile_opts
=
''
locale
=
''
if
env
.
site_languages
:
locale
=
'--locale="{}"'
.
format
(
env
.
site_languages
.
split
(
','
)[
0
])
if
env
.
site_conf
and
env
.
site_profile
==
"config_installer"
:
profile_opts
+=
" config_installer "
\
"config_installer_sync_configure_form.sync_directory="
\
"{}"
.
format
(
env
.
site_conf
)
dk_run
(
service
,
user
=
'root'
,
cmd
=
'chown -R {}:{} .'
.
format
(
env
.
apache_userid
,
env
.
local_userid
))
if
env
.
drupal_version
==
8
:
...
...
@@ -124,11 +130,12 @@ def site_install():
dk_run
(
service
,
cmd
=
"drush site-install {} {} --db-url=mysql://{}:{}@{}/{} "
cmd
=
"drush site-install {} {}
{}
--db-url=mysql://{}:{}@{}/{} "
"--site-name='{}' --account-name={} --account-pass={} "
"--sites-subdir={} -y"
""
.
format
(
profile
,
locale
,
db_user
,
db_pass
,
db_host
,
db_name
,
site_name
,
site_admin_name
,
site_admin_pass
,
site_subdir
)
""
.
format
(
profile
,
profile_opts
,
locale
,
db_user
,
db_pass
,
db_host
,
db_name
,
site_name
,
site_admin_name
,
site_admin_pass
,
site_subdir
)
)
fix_permissions
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment