Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Clear Drupal 7 cache.
ansible.builtin.command:
cmd: "{{ drush_bin }} -l {{ site.folder }} -y cc all"
chdir: "{{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }}"
become: "{{ 'no' if www_user == deploy_user else 'yes' }}"
become_user: "{{ www_user }}"
with_items: "{{ drupal.sites }}"
loop_control:
loop_var: site
run_once: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Clear Drupal cache.
ansible.builtin.command:
cmd: "{{ drush_bin }} -l {{ site.folder }} -y cr"
chdir: "{{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }}"
become: "{{ 'no' if www_user == deploy_user else 'yes' }}"
become_user: "{{ www_user }}"
with_items: "{{ drupal.sites }}"
loop_control:
loop_var: site
run_once: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Check if Features module is enabled.
ansible.builtin.shell: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drush_bin }} -l {{ site.folder }} pm-info features | grep ': enabled' | wc -l"
register: features_enabled

- name: Revert Drupal configuration from Features.
ansible.builtin.shell: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drush_bin }} -l {{ site.folder }} -y {{ site.revert_features_command }}"
when: features_enabled.stdout == "1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Apply Drupal database updates.
ansible.builtin.shell:
cmd: "{{ drush_bin }} -l {{ site.folder }} -y updb"
chdir: "{{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }}"
with_items: "{{ drupal.sites }}"
loop_control:
loop_var: site

- name: Revert Drupal configuration with Features.
ansible.builtin.include_tasks: features.yml
with_items: "{{ drupal.sites }}"
loop_control:
loop_var: site
when:
- site.revert_features_command

- name: Clear the cache.
ansible.builtin.include_role:
name: "sync/drupal_sync_tasks/clear_cache/clear_cache-{{ project_type }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Apply Drupal database updates.
ansible.builtin.command:
cmd: "{{ drush_bin }} -l {{ site.folder }} -y updb"
chdir: "{{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }}"
become: "{{ 'no' if www_user == deploy_user else 'yes' }}"
become_user: "{{ www_user }}"
with_items: "{{ drupal.sites }}"
loop_control:
loop_var: site

- name: Import configuration.
ansible.builtin.command:
cmd: "{{ drush_bin }} -l {{ site.folder }} -y {{ site.config_import_command }}"
chdir: "{{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }}"
become: "{{ 'no' if www_user == deploy_user else 'yes' }}"
become_user: "{{ www_user }}"
with_items: "{{ drupal.sites }}"
loop_control:
loop_var: site
when:
- site.config_import_command

- name: Clear the cache.
ansible.builtin.include_role:
name: "sync/drupal_sync_tasks/clear_cache/clear_cache-{{ project_type }}"
6 changes: 6 additions & 0 deletions roles/sync/drupal_sync_tasks/database_apply/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Apply database updates.
ansible.builtin.include_role:
name: "sync/drupal_sync_tasks/database_apply/database_apply-{{ project_type }}"
when: deploy_operation == 'deploy'
run_once: true