Skip to content

Instantly share code, notes, and snippets.

@andreiglingeanu
Created May 24, 2016 14:34
Show Gist options
  • Save andreiglingeanu/311f1857050271b39a5034d17d287a7c to your computer and use it in GitHub Desktop.
Save andreiglingeanu/311f1857050271b39a5034d17d287a7c to your computer and use it in GitHub Desktop.
Install fresh wordpress wth unyson and it's scratch theme. Requires wp-cli to be installed and available in PATH.
#!/bin/bash
#
# USAGE: unyson-testing wp-test
#
# Some steps may not be required for you. You welcome to fork the gist
# and make it the way you like it.
#
# Install fresh wordpress with unyson
mkdir $1
cd $1
wp core download
# Please note that you'll have to check that you don't repeat your db name
mysql -u root -e "CREATE DATABASE wp_test_$1 CHARACTER SET utf8 COLLATE utf8_bin;"
wp core config --dbname=wp_test_$1 --dbuser=root --dbpass="" --extra-php <<PHP
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
PHP
wp core install --title="Happy debugging!" --admin_user="admin" --admin_password="123" --admin_email="email@email.com" --skip-email --url="http://localhost:3003/"
# Latest unyson
cd wp-content/plugins
git clone git@github.com:ThemeFuse/Unyson.git unyson
cd unyson/framework/extensions
chmod +x clone-all.bash
./clone-all.bash
wp plugin activate unyson
cd ../../../../../
# Latest scratch theme
cd wp-content/themes
git clone git@github.com:ThemeFuse/Scratch-Theme.git scratch
mv scratch/scratch* .
rm -rf scratch
wp theme activate scratch-parent
cd ../..
open "http://localhost:3003/wp-admin/post-new.php?post_type=page"
# Close all php server instances
ps aux | grep php | awk '{print $2}' | xargs kill -9 &>/dev/null
# Boot a new server
wp server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment