Last active
September 24, 2024 21:48
-
-
Save studiocaro/a8fc58554f6cedfb300747659fcf8c0c to your computer and use it in GitHub Desktop.
My workflow contains Bedrock, Sage and Valet from Laravel. The latter is something you'll have to install first, otherwise this script won't work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "π π Congrats with the new project! π π | |
I'm setting up your fresh WordPress install for you." | |
# Make new folder | |
printf "Enter folder name of your choice -> " | |
read FOLDER | |
mkdir $FOLDER | |
cd $FOLDER | |
# Configure URL (automatic .dev extension) and database | |
printf "Enter local project name your choice -> " | |
read NAME | |
# Install Bedrock | |
git clone https://github.com/roots/bedrock.git . | |
# Installing dependencies and default WordPress plugins | |
composer require "wpackagist-plugin/wordpress-seo" | |
composer require "wpackagist-plugin/wp-statistics" | |
composer install | |
# Create our database | |
mysql -u root -e "create database $NAME"; | |
# Set up .env file | |
echo " | |
DB_NAME=$NAME | |
DB_USER=root | |
DB_PASSWORD= | |
DB_HOST=127.0.0.1 | |
WP_ENV=development | |
WP_HOME=http://$NAME.dev | |
WP_SITEURL=\${WP_HOME}/wp | |
# Generate your keys here: https://roots.io/salts.html | |
AUTH_KEY='generateme' | |
SECURE_AUTH_KEY='generateme' | |
LOGGED_IN_KEY='generateme' | |
NONCE_KEY='generateme' | |
AUTH_SALT='generateme' | |
SECURE_AUTH_SALT='generateme' | |
LOGGED_IN_SALT='generateme' | |
NONCE_SALT='generateme'" >.env | |
# Go to the right folder for Valet | |
cd ~/Sites/$FOLDER/web | |
# Set up Valet environment | |
valet link $NAME | |
# Configurate Wordpress | |
wp core install --url=http://$NAME.dev/ --title=WordPress --admin_user=admin --admin_password=mypassword --admin_email=youremail | |
wp core language install nl_NL --activate | |
# Install and activate Sage starter theme | |
cd ~/Sites/$FOLDER/web/app/themes | |
git clone https://github.com/roots/sage.git $NAME | |
wp theme activate $NAME | |
# Install bower and gulp | |
cd ~/Sites/$FOLDER/web/app/themes/$NAME | |
bower install | |
npm install | |
# End message | |
echo "You're ready for take-off! | |
π π π π π | |
Login: admin | |
Pass: mypassword" | |
# Show me the site | |
open -a "Google Chrome" http://$NAME.dev | |
# Start developing | |
gulp | |
gulp watch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment