Skip to content

Commit

Permalink
Merge pull request #187 from CuBoulder/hotfix/186
Browse files Browse the repository at this point in the history
Run registry rebuild separately to make sure all hosts have the new c…
  • Loading branch information
kreynen committed Mar 2, 2017
2 parents d8804f5 + d2de4d2 commit dc25ced
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
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

0 comments on commit dc25ced

Please sign in to comment.