-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a charm action to run wp core update db after a wordpress upgr…
…ade (#235) * Added the `update-database` action. I need feedback and advice on what kind of tests I need to write. * Added `dry-run` parameter * Wrote unit tests for `update-database` action * Removed blank lines after docstring * Fixed error message if action fails. * Making sure stderr exists and a str in action fail * Fixed number of commands in mock * Updated uni tests * Removed unnecessary else * Better debug and auto update-database when charm upgrades * Fix forgotten docstring * Removed empty line after docstring. * Better handle parameters get * Fixed docstring * Make linter happy. * Wrote how-to document for charm update * Add final new line * Removed update function from on-upgrade event, private function rearrangement, function re-order. * Document updates * Initialized test fail parameter and updated docstring * Fixed private function returning wrong type. * Fixed mock return results for database update * Happy linter happy life * Better documentation
- Loading branch information
1 parent
fa772ca
commit fc9c2b6
Showing
5 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# How to upgrade WordPress Charm | ||
|
||
Before updating the Charm you need to backup the database using MySQL charm's `create-backup` action. | ||
|
||
``` | ||
juju run mysql/leader create-backup | ||
``` | ||
Additional info can be found about backup in [the MySQL documentation](https://charmhub.io/mysql/docs/h-create-and-list-backups) | ||
|
||
Then you can upgrade the WordPress Charm. | ||
|
||
``` | ||
juju refresh wordpress-k8s | ||
``` | ||
|
||
After upgrading the WordPress Charm you need to update the database schema. | ||
|
||
``` | ||
juju run wordpress-k8s/0 update-database | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters