Skip to content

Commit

Permalink
Merge pull request #7 from sitewards/ADHOC-add-reindex-to-deploy
Browse files Browse the repository at this point in the history
AHOC feat (installation): let indexer run
  • Loading branch information
aboritskiy authored Aug 30, 2019
2 parents b9e6368 + 0a9fc7f commit 519ce3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,8 @@ magento_queue_consumers_cron_template: "/usr/bin/php {{ magento_app_root }}/bin/
magento_cleanup_old_clones: True
magento_clones_to_keep: 5
magento_clones_cleanup_min_age: "1d"

## Enforces indexer run on every deploy
## by default indexer will run only in case database was created from scratch.
## In case you need to refresh indexes on deploy (e.g. to fill search index) - set this to true.
magento_force_reindex_on_deploy: False
6 changes: 6 additions & 0 deletions tasks/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@
become_user: "{{ magento_user }}"
command: "/usr/bin/php {{ magento_app_root }}/bin/magento cache:flush"

- name: "Let Magento indexer run"
become: "yes"
become_user: "{{ magento_user }}"
command: "/usr/bin/php {{ magento_app_root }}/bin/magento indexer:reindex"
when: magento_db_status.stdout_lines|length == 0 or magento_force_reindex_on_deploy == True

- name: "Disable maintenance mode"
file:
path: "{{ magento_release_folder }}/{{ magento_release_version }}/var/.maintenance.flag"
Expand Down

0 comments on commit 519ce3c

Please sign in to comment.