From 526f567da1b68ba78a5d7d6b3e4ff73cd480f29e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 8 Feb 2020 00:24:26 +0000 Subject: [PATCH] Run more Drush commands during deployment --- tools/ansible/deploy/after-update-code.yml | 9 +++++++++ tools/ansible/vars/deploy_vars.yml | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/ansible/deploy/after-update-code.yml b/tools/ansible/deploy/after-update-code.yml index f5ba334..1237e42 100644 --- a/tools/ansible/deploy/after-update-code.yml +++ b/tools/ansible/deploy/after-update-code.yml @@ -7,3 +7,12 @@ - name: Generate settings.php file include_role: name: './roles/drupal-settings' + +- name: Import configuration + command: '{{ release_drush_path }} config-import -y chdir={{ release_web_path }}' + +- name: Run database updates + command: '{{ release_drush_path }} updatedb -y chdir={{ release_web_path }}' + +- name: Rebuild cache + command: '{{ release_drush_path }} cache-rebuild chdir={{ release_web_path }}' diff --git a/tools/ansible/vars/deploy_vars.yml b/tools/ansible/vars/deploy_vars.yml index 1aebbf9..db7df9b 100644 --- a/tools/ansible/vars/deploy_vars.yml +++ b/tools/ansible/vars/deploy_vars.yml @@ -15,8 +15,11 @@ ansistrano_after_update_code_tasks_file: '{{ playbook_dir }}/deploy/after-update app_hash_salt: '{{ vault_app_hash_salt }}' +release_drush_path: '{{ ansistrano_release_path.stdout }}/vendor/bin/drush' +release_web_path: '{{ ansistrano_release_path.stdout }}/{{ project_web_dir }}' + drupal_settings: - - drupal_root: '{{ ansistrano_release_path.stdout }}/{{ project_web_dir }}' + - drupal_root: '{{ release_web_path }}' sites: - name: default settings: