Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run registry rebuild separately to make sure all hosts have the new c… #187

Merged
merged 1 commit into from
Mar 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions fabfile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ def site_package_update(site):
run("rm -rf modules/custom modules/contrib")
run("drush dslm-remove-all-packages")
run("drush dslm-add-package {0}".format(package_name_string))
if len(package_name_string) > 0:
print('Rebuild registry.')
run("drush rr")


@roles('webservers')
Expand All @@ -243,8 +240,6 @@ def site_profile_update(site, original, updates):
code_root,
new_profile['meta']['name'],
new_profile_full_string))
print('Rebuild registry.')
run("drush rr")


@roles('webservers')
Expand Down Expand Up @@ -453,6 +448,20 @@ def update_database(site):
run("drush updb -y")


@roles('webserver_single')
def registry_rebuild(site):
"""
Run a drush rr

:param site: Site to run command on
:return:
"""
print('Drush registry rebuild\n{0}'.format(site))
code_directory_sid = '{0}/{1}/{1}'.format(sites_code_root, site['sid'])
with cd(code_directory_sid):
run("drush rr")


@roles('webservers')
def clear_apc():
run("wget -q -O - http://localhost/sysadmintools/apc/clearapc.php")
Expand Down Expand Up @@ -485,8 +494,6 @@ def rewrite_symlinks(site):
if site['status'] == 'launched' and site['pool'] == 'poolb-homepage':
web_directory = '{0}/{1}'.format(sites_web_root, 'homepage')
_update_symlink(code_directory_current, web_directory)
with cd(web_directory):
run("drush rr")


@roles('webservers')
Expand Down
5 changes: 5 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ def site_import_from_inventory(site):
logger.debug(rewrite_symlinks_task)
logger.debug(rewrite_symlinks_task.values)

rewrite_symlinks_task = execute(fabfile.registry_rebuild, site=site)
logger.debug(rewrite_symlinks_task)
logger.debug(rewrite_symlinks_task.values)

database_update_task = execute(fabfile.update_database, site=site)
logger.debug(database_update_task)
logger.debug(database_update_task.values)
Expand Down Expand Up @@ -239,6 +243,7 @@ def site_update(site, updates, original):
package_change = True
execute(fabfile.site_package_update, site=site)
if core_change or profile_change or package_change:
execute(fabfile.registry_rebuild, site=site)
execute(fabfile.update_database, site=site)

if updates.get('status'):
Expand Down