From 7fddadae52910d94517fe0a87144e87aa4078fb3 Mon Sep 17 00:00:00 2001 From: gregharvey Date: Fri, 9 Dec 2022 14:02:40 +0100 Subject: [PATCH 1/2] Handling the 'drush deploy' command more elegantly for Drupal 8+. --- roles/database_apply/database_apply-drupal8/tasks/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/database_apply/database_apply-drupal8/tasks/main.yml b/roles/database_apply/database_apply-drupal8/tasks/main.yml index 23cb0b3b..88d737b5 100644 --- a/roles/database_apply/database_apply-drupal8/tasks/main.yml +++ b/roles/database_apply/database_apply-drupal8/tasks/main.yml @@ -22,7 +22,7 @@ with_items: "{{ drupal.sites }}" loop_control: loop_var: site - when: previous_build_number == 0 or (site.force_install is defined and site.force_install) + when: (previous_build_number == 0) or (site.force_install is defined and site.force_install) - name: Fix permissions on Drupal directory. shell: @@ -30,12 +30,12 @@ with_items: "{{ drupal.sites }}" loop_control: loop_var: site - when: previous_build_number == 0 or (site.force_install is defined and site.force_install) + when: (previous_build_number == 0) or (site.force_install is defined and site.force_install) - name: Clear the cache. ansible.builtin.include_role: name: "cache_clear/cache_clear-{{ project_type }}" - when: previous_build_number > 0 + when: (previous_build_number > 0) or (site.config_import_command != 'deploy') - name: Apply Drupal database updates. command: @@ -46,6 +46,7 @@ with_items: "{{ drupal.sites }}" loop_control: loop_var: site + when: site.config_import_command != 'deploy' - name: Import configuration. command: From 0fe2704dfdad1f7c2431b6680e6ab98ec617b630 Mon Sep 17 00:00:00 2001 From: gregharvey Date: Fri, 9 Dec 2022 14:21:38 +0100 Subject: [PATCH 2/2] Changing logic to AND for cache rebuild. --- roles/database_apply/database_apply-drupal8/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/database_apply/database_apply-drupal8/tasks/main.yml b/roles/database_apply/database_apply-drupal8/tasks/main.yml index 88d737b5..3473d9e8 100644 --- a/roles/database_apply/database_apply-drupal8/tasks/main.yml +++ b/roles/database_apply/database_apply-drupal8/tasks/main.yml @@ -35,7 +35,9 @@ - name: Clear the cache. ansible.builtin.include_role: name: "cache_clear/cache_clear-{{ project_type }}" - when: (previous_build_number > 0) or (site.config_import_command != 'deploy') + when: + - previous_build_number > 0 + - site.config_import_command != 'deploy' - name: Apply Drupal database updates. command: