diff --git a/.env.sample b/.env.sample index d74bed7..5983020 100644 --- a/.env.sample +++ b/.env.sample @@ -16,6 +16,17 @@ LETS_ENCRYPT_ENV=production # Setup Wordpress settings on each deploy: #POST_DEPLOY_CMDS="app core_install" +# Install plugins and themes on deploy (space-separated slugs) +# Ensure POST_DEPLOY_CMDS includes "app install_plugins" and/or "app install_themes" +#WORDPRESS_PLUGINS="wordpress-importer two-factor" +#WORDPRESS_THEMES="twentytwentyfive" + +# Remove plugins on deploy (space-separated slugs) +# Ensure POST_DEPLOY_CMDS includes "app remove_plugins" +#WORDPRESS_REMOVE_PLUGINS="akismet hello" +# Or remove the default Akismet and Hello Dolly plugins +#POST_DEPLOY_CMDS="app remove_default_plugins" + # Optional settings, otherwise can be set in the installer # (Required for `app core_install` #TITLE="My Example Blog" diff --git a/abra.sh b/abra.sh index 56b78ce..7cfc76f 100644 --- a/abra.sh +++ b/abra.sh @@ -1,5 +1,5 @@ export PHP_UPLOADS_CONF_VERSION=v4 -export ENTRYPOINT_CONF_VERSION=v9 +export ENTRYPOINT_CONF_VERSION=v10 export ENTRYPOINT_MAILRELAY_CONF_VERSION=v2 export MSMTP_CONF_VERSION=v4 export HTACCESS_CONF_VERSION=v3 @@ -107,3 +107,27 @@ fix_mysql() { show_plugins() { wp "plugin list --fields=name,status,wporg_status,version,update_version,auto_update,tested_up_to,wporg_last_updated" } + +install_plugins() { + for plugin in $WORDPRESS_PLUGINS; do + wp "plugin install --activate $plugin" + done +} + +install_themes() { + for theme in $WORDPRESS_THEMES; do + wp "theme install --activate $theme" + done +} + +remove_plugins() { + for plugin in $WORDPRESS_REMOVE_PLUGINS; do + wp "plugin is-installed $plugin" && wp "plugin uninstall $plugin" + done +} + +remove_default_plugins() { + for plugin in akismet hello; do + wp "plugin is-installed $plugin" && wp "plugin uninstall $plugin" + done +}