From b402df87af743f57755710563dfb4dcb0c81d958 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 23 Jan 2019 14:00:32 +0000 Subject: [PATCH] Add Drush tasks --- ansible/deploy.yml | 5 +++++ ansible/deploy/after-symlink-shared.yml | 6 ++---- ansible/deploy/after-symlink.yml | 3 +++ ansible/deploy/after-update-code.yml | 5 +++++ 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 ansible/deploy/after-symlink.yml create mode 100644 ansible/deploy/after-update-code.yml diff --git a/ansible/deploy.yml b/ansible/deploy.yml index 5d9e71c..759f55f 100644 --- a/ansible/deploy.yml +++ b/ansible/deploy.yml @@ -14,7 +14,12 @@ ansistrano_deploy_to: "{{ app_project_root }}" ansistrano_keep_releases: 5 ansistrano_after_symlink_shared_tasks_file: "{{ playbook_dir }}/deploy/after-symlink-shared.yml" + ansistrano_after_symlink_tasks_file: "{{ playbook_dir }}/deploy/after-symlink.yml" + ansistrano_after_update_code_tasks_file: "{{ playbook_dir }}/deploy/after-update-code.yml" ansistrano_shared_paths: - "{{ app_project_subdir }}/sites/default/files" ansistrano_shared_files: - "{{ app_project_subdir }}/sites/default/settings.php" + + release_web_path: "{{ ansistrano_release_path.stdout }}/web" + release_drush_path: "{{ ansistrano_release_path.stdout }}/vendor/bin/drush" diff --git a/ansible/deploy/after-symlink-shared.yml b/ansible/deploy/after-symlink-shared.yml index 6133fba..e62c0bd 100644 --- a/ansible/deploy/after-symlink-shared.yml +++ b/ansible/deploy/after-symlink-shared.yml @@ -1,5 +1,3 @@ --- -- name: Install Composer dependencies - composer: - command: install - working_dir: '{{ ansistrano_release_path.stdout }}' +- name: Run database updates + command: '{{ release_drush_path }} --root {{ release_web_path }} updatedb' diff --git a/ansible/deploy/after-symlink.yml b/ansible/deploy/after-symlink.yml new file mode 100644 index 0000000..2f2b2b8 --- /dev/null +++ b/ansible/deploy/after-symlink.yml @@ -0,0 +1,3 @@ +--- +- name: Clear Drupal cache + command: '{{ release_drush_path }} --root {{ release_web_path }} cache-rebuild' diff --git a/ansible/deploy/after-update-code.yml b/ansible/deploy/after-update-code.yml new file mode 100644 index 0000000..6133fba --- /dev/null +++ b/ansible/deploy/after-update-code.yml @@ -0,0 +1,5 @@ +--- +- name: Install Composer dependencies + composer: + command: install + working_dir: '{{ ansistrano_release_path.stdout }}'