Last active
October 4, 2022 19:37
-
-
Save dawidurbanski/ad7c4cf5cf72bb901f4630e141608688 to your computer and use it in GitHub Desktop.
Install wordpress with wp-cli using Bedrock installation
This file contains hidden or 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
| #!/bin/bash | |
| # webiste info | |
| WP_TITLE=${WP_SITENAME//\"/} | |
| WP_HOME=$WP_HOME | |
| WP_USER=$WP_ADMIN_NAME | |
| WP_PASSWORD=$WP_ADMIN_PASS | |
| WP_EMAIL=$WP_ADMIN_EMAIL | |
| # install | |
| if ! $( wp core is-installed --allow-root --path=/var/www/html/web/wp ); then | |
| # install wordpress | |
| wp core install \ | |
| --url=$WP_HOME \ | |
| --title="$WP_TITLE" \ | |
| --admin_user=$WP_USER \ | |
| --admin_password=$WP_PASSWORD \ | |
| --admin_email=$WP_EMAIL \ | |
| --skip-email \ | |
| --allow-root \ | |
| --path=/var/www/html/web/wp | |
| # enable all available plugins | |
| wp plugin activate --all | |
| fi | |
| # refresh permalinks | |
| wp rewrite structure '/%postname%/' --hard --allow-root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment