Skip to content

Instantly share code, notes, and snippets.

@alyssais
Last active August 17, 2017 15:25
Show Gist options
  • Save alyssais/e714320e0cd8db98e7d82f324b9d2ccb to your computer and use it in GitHub Desktop.
Save alyssais/e714320e0cd8db98e7d82f324b9d2ccb to your computer and use it in GitHub Desktop.
Automatic Wordpress development environment setup using Homebrew (https://brew.sh), Composer (https://getcomposer.org), and Scripts to Rule Them All (https://githubengineering.com/scripts-to-rule-them-all/). Dashes in filenames represent directory separators. License CC0.
tap "homebrew/php"
brew "php71"
brew "mysql"
brew "composer"
{
"require-dev": {
"wp-cli/wp-cli": "^1.1"
}
}
#!/bin/sh
set -ue
cd "$(dirname "$0")/.."
brew bundle check || brew bundle
composer update
#!/bin/sh
set -ue
cd "$(dirname "$0")/.."
script/update
export PATH="vendor/bin:$PATH"
wp shell
#!/bin/sh
set -ue
cd "$(dirname "$0")/.."
script/update
export PATH="vendor/bin:$PATH"
wp server
#!/bin/sh
set -ue
cd "$(dirname "$0")/.."
script/bootstrap
export PATH="vendor/bin:$PATH"
wp core config --dbname="$(basename "$PWD")" --dbuser=root --force
wp db drop --yes 2> /dev/null || true
wp db create
wp core install --url=http://localhost:8080 --title="Site name" \
--admin_user="$USER" --admin_email="$(git config user.email)" \
--admin_password=helloworld --skip-email
#!/bin/sh
set -ue
cd "$(dirname "$0")/.."
brew bundle check || brew bundle
composer update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment