Skip to content

Commit

Permalink
Put composer update before metastore upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Brooks authored Dec 9, 2024
1 parent 2625106 commit 82b8e2d
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/roles/mediawiki/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -532,37 +532,29 @@
# es_do_upgrade: False
# when: not es_do_upgrade_stat.stat.exists

- 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
# These next 3 tasks are meant to get the submodules for mediawiki
# There's probably a better way to do this
- name: Remove vendor directory - Run if metastore index upgrade fails
- name: Remove vendor directory
shell: "rm -rf {{ m_mediawiki }}/vendor"
run_once: true
when: metastore_upgrade_result.failed

- name: Remove composer.lock - Run if metastore index upgrade fails
- name: Remove composer.lock
shell: "rm {{ m_mediawiki }}/composer.lock"
run_once: true
when: metastore_upgrade_result.failed

- name: Run composer update - Run if metastore index upgrade fails
- name: Run composer update
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
- 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: metastore_upgrade_result.failed
when: docker_skip_tasks is not defined or not docker_skip_tasks

# Wikis are totally built at this point, but search needs rebuilding
# FIXME #811: Will this work when controller is not an app server?
Expand Down

0 comments on commit 82b8e2d

Please sign in to comment.