-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Conversation
3a5d114
to
f31fd08
Compare
Tested and working now. |
when: wp_installed.rc == 0 and not (project.multisite.enabled | default(False) == True) | ||
|
||
- name: Update WP network database | ||
command: wp core update-db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing --network
here?
should we note that this could take a really long time for larger networks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Musta gotten lost in a copy/paste.
Added a message. Let me know if you have a preference on the copy.
34fd1ee
to
faf1dab
Compare
command: wp core update-db | ||
args: | ||
chdir: "{{ deploy_helper.new_release_path }}" | ||
when: wp_installed.rc == 0 and not (project.multisite.enabled | default(False) == True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can all use when: wp_installed | success
Also shouldn't need last ==
, so:
wp_installed | success and not (project.multisite.enabled | default(false))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. I pulled wp_installed.rc == 0
from line 14; should I fix that too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh and the parentheses aren't need either but it might be a subjective thing:
wp_installed | success and not project.multisite.enabled | default(false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and done.
fcb6fef
to
b1c2ed0
Compare
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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug:
msg:
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
This is looking good 👍 Probably will want to do some tests ourselves but it's pretty straightforward. |
b1c2ed0
to
28dd549
Compare
@mAAdhaTTah this is good to go. Can you squash commits? |
28dd549
to
edf14d3
Compare
@swalkinshaw done! |
Add `wp core update-db` to finalize hook
Thanks! |
Fixes #398.
Couple things: first, I think this is where this is supposed to go, but if I'm reading this right, it doesn't look like this file is actually run during the deployment process and works more like an example? And second, the reason I don't know the answer to that is I haven't fully tested it because I'm running an old version of Trellis that I need to upgrade to the latest variable configuration (you'll notice my fork is still namedbedrock-ansible
).That said,I'm opening this up for comments, since this is my first Ansible task (which, as a side note, is a really neat benefit of the deployment hooks: it allows you to dip your toes into writing Ansible tasks without needing to understand everything at once).Thoughts?