From 2625106fb24d1b5ac0e6483a85d46674e0ad4396 Mon Sep 17 00:00:00 2001 From: Vincent Brooks <38259624+V-Brooks@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:25:32 -0600 Subject: [PATCH] Force composer update on mediawiki files to update submodules --- src/roles/mediawiki/tasks/main.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/roles/mediawiki/tasks/main.yml b/src/roles/mediawiki/tasks/main.yml index 41506380..fb5c57d9 100644 --- a/src/roles/mediawiki/tasks/main.yml +++ b/src/roles/mediawiki/tasks/main.yml @@ -534,9 +534,36 @@ - name: Verify metastore index upgraded shell: WIKI={{ list_of_wikis[0] }} php {{ m_mediawiki }}/extensions/CirrusSearch/maintenance/Metastore.php --upgrade + register: metastore_upgrade_result run_once: true when: docker_skip_tasks is not defined or not docker_skip_tasks +# Run these tasks if the task above fails +# There's probably a better way to do this +- name: Remove vendor directory - Run if metastore index upgrade fails + shell: "rm -rf {{ m_mediawiki }}/vendor" + run_once: true + when: metastore_upgrade_result.failed + +- name: Remove composer.lock - Run if metastore index upgrade fails + shell: "rm {{ m_mediawiki }}/composer.lock" + run_once: true + when: metastore_upgrade_result.failed + +- name: Run composer update - Run if metastore index upgrade fails + become: yes + become_user: "meza-ansible" + composer: + command: update + working_dir: "{{ m_mediawiki }}" + no_dev: yes + when: metastore_upgrade_result.failed + +- name: Retry - Verify metastore index upgraded + shell: WIKI={{ list_of_wikis[0] }} php {{ m_mediawiki }}/extensions/CirrusSearch/maintenance/Metastore.php --upgrade + run_once: true + when: metastore_upgrade_result.failed + # Wikis are totally built at this point, but search needs rebuilding # FIXME #811: Will this work when controller is not an app server? - name: "(Re-)build search index for: {{ wikis_to_rebuild_data | join(', ') }}"