Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wp core update-db to finalize hook #411

Merged
merged 1 commit into from
Dec 22, 2015
Merged
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
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