This commit is contained in:
Alex P 2022-05-05 15:50:21 +03:00
parent 00cfa973e6
commit df6e784d29
14 changed files with 369 additions and 0 deletions

View file

@ -0,0 +1,6 @@
#!/bin/bash
if ! wp core download; then
echo 'WordPress is already installed.'
exit
fi

View file

@ -0,0 +1,6 @@
#!/bin/bash
cat << 'EOF' > ".gitignore"
# ignores everything in the docroot (docroot in config.yaml), this path may not be included in the standard .ddev/.gitignore.
*
EOF

View file

@ -0,0 +1,22 @@
#!/bin/bash
# Create wp-config.php
# the PHP snippet avoids some notices during CLI calls
# https://make.wordpress.org/cli/handbook/guides/common-issues/#php-notice-undefined-index-on-_server-superglobal
printf '
if ( defined( "WP_CLI" ) && WP_CLI && ! isset( $_SERVER["HTTP_HOST"] ) ) {
$_SERVER["HTTP_HOST"] = "%s";
}
' "${DDEV_HOSTNAME}" | wp config create \
--dbname=db \
--dbuser=db \
--dbpass=db \
--dbhost=db \
--force \
--extra-php
wp config set WP_DEBUG true --raw
wp config set WP_DEBUG_DISPLAY true --raw
wp config set WP_DEBUG_LOG true --raw
wp config set WP_SITEURL '(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] ? "https://" : "http://") . $_SERVER["HTTP_HOST"]' --raw
wp config set WP_HOME '(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] ? "https://" : "http://") . $_SERVER["HTTP_HOST"]' --raw

View file

@ -0,0 +1,15 @@
#!/bin/bash
if [ ! -z "${RECREATE_ENV}" ]; then
echo "Deleting database before creating a new one"
wp db clean --yes
fi
wp core install \
--title="${WP_TITLE}" \
--admin_user="${ADMIN_USER}" \
--admin_password="${ADMIN_PASS}" \
--url="${DDEV_PRIMARY_URL}" \
--admin_email="${ADMIN_EMAIL}" \
--skip-email

View file

@ -0,0 +1,4 @@
#!/bin/bash
wp plugin is-installed akismet && wp plugin uninstall akismet
wp plugin is-installed hello && wp plugin uninstall hello

View file

@ -0,0 +1,6 @@
#!/bin/bash
popd
composer install
yarn run build:dev

View file

@ -0,0 +1,5 @@
#!/bin/bash
pushd "${DDEV_DOCROOT}"
wp plugin activate "${PLUGIN_NAME:-$DDEV_PROJECT}"

View file

@ -0,0 +1,3 @@
#!/bin/bash
wp plugin install woocommerce --version="${WC_VERSION}" --activate

View file

@ -0,0 +1,9 @@
#!/bin/bash
# Needed for generating the .htaccess file
echo "apache_modules:
- mod_rewrite
" > wp-cli.yml
wp rewrite structure '/%postname%'
wp rewrite flush --hard

View file

@ -0,0 +1,3 @@
#!/bin/bash
wp theme install storefront --activate