Skip to content

Commit

Permalink
Add wp core update-db to finalize hook
Browse files Browse the repository at this point in the history
  • Loading branch information
mAAdhaTTah committed Dec 22, 2015
1 parent 4f6c53c commit edf14d3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion roles/deploy/hooks/finalize-after.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,24 @@
command: wp eval 'wp_clean_themes_cache(); switch_theme(get_stylesheet());'
args:
chdir: "{{ deploy_helper.new_release_path }}"
when: wp_installed.rc == 0
when: wp_installed | success

- name: Update WP database
command: wp core update-db
args:
chdir: "{{ deploy_helper.new_release_path }}"
when: wp_installed | success and not project.multisite.enabled | default(false)

- name: Warn about updating network database.
debug:
msg: "Updating the network database could take a long time with a large number of sites."
when: wp_installed | success and project.multisite.enabled | default(false)

- name: Update WP network database
command: wp core update-db --network
args:
chdir: "{{ deploy_helper.new_release_path }}"
when: wp_installed | success and project.multisite.enabled | default(false)

- name: Reload php5-fpm
shell: sudo service php5-fpm reload
Expand Down

0 comments on commit edf14d3

Please sign in to comment.