From cee084092b558eef1bae948893990a5c21b1dae0 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 20 May 2020 12:22:43 +0100 Subject: [PATCH] Re-order deployment steps Re-order the deployment steps, ensuring that the Drupal cache is rebuilt before trying to run the custom Drush command to ensure that it is found. References #55. --- tools/ansible/deploy/after-update-code.yml | 35 ++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tools/ansible/deploy/after-update-code.yml b/tools/ansible/deploy/after-update-code.yml index a097f50..3ea25e2 100644 --- a/tools/ansible/deploy/after-update-code.yml +++ b/tools/ansible/deploy/after-update-code.yml @@ -4,6 +4,25 @@ command: install working_dir: '{{ ansistrano_release_path.stdout }}' +- name: Generate settings.php file + include_role: + name: opdavies.drupal_settings_files + +- name: Import configuration + command: '{{ release_drush_path }} config-import -y' + args: + chdir: '{{ release_web_path }}' + +- name: Run database updates + command: '{{ release_drush_path }} updatedb -y' + args: + chdir: '{{ release_web_path }}' + +- name: Rebuild cache + command: '{{ release_drush_path }} cache-rebuild' + args: + chdir: '{{ release_web_path }}' + - name: Generate front-end assets command: | {{ item.command }} @@ -27,21 +46,7 @@ - body-field-values.txt - node_modules -- name: Generate settings.php file - include_role: - name: opdavies.drupal_settings_files - -- name: Import configuration - command: '{{ release_drush_path }} config-import -y' - args: - chdir: '{{ release_web_path }}' - -- name: Run database updates - command: '{{ release_drush_path }} updatedb -y' - args: - chdir: '{{ release_web_path }}' - -- name: Rebuild cache +- name: Rebuild cache again command: '{{ release_drush_path }} cache-rebuild' args: chdir: '{{ release_web_path }}'