Skip to content

Instantly share code, notes, and snippets.

@danielpataki
Created November 24, 2014 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpataki/2093481b226b8e64d567 to your computer and use it in GitHub Desktop.
Save danielpataki/2093481b226b8e64d567 to your computer and use it in GitHub Desktop.
W-CLI Script
#!/bin/bash
# Setup Variables
DBNAME=blog
DBUSER=root
DBPASS=root
DBHOST=localhost
DBPREFIX=9239jej9md_
URL=http://blog.local
TITLE=blog
ADMINUSER=danielpataki
ADMINPASS=danielpataki
ADMINEMAIL=mymail@mail.com
REPOPLUGINS="advanced-custom-fields regenerate-thumbnails wordpress-importer"
REPOTHEMES="sorbet"
ACTIVETHEME="sorbet"
# Install WordPress
wp core download;
wp core config --dbname=${DBNAME} --dbuser=${DBUSER} --dbpass=${DBPASS} --dbhost=${DBHOST} --dbprefix=${DBPREFIX} --extra-php <<PHP
define( 'WP_DEBUG', true );
PHP
wp db create;
wp core install --url=${URL} --title=${TITLE} --admin_user=${ADMINUSER} --admin_password=${ADMINPASS} --admin_email=${ADMINEMAIL}
# Delete Base Plugins
wp plugin delete hello akismet
# Install Repo Plugins
wp plugin install ${REPOPLUGINS} --activate
# Install Themes
wp theme install ${REPOTHEMES}
wp theme activate ${ACTIVETHEME}
# Misc Cleanup
wp post delete 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment