# Automation Tools
Start by cloning the repository from here (opens new window)
git clone git@gitlab.com:three11/wp-automation.git
Make sure that it is located in a place different than your project root.
For example /Users/YOUR_USER_NAME/server/tools.
If the automation is not configured, please see Installation and configuration
# Usage
# Create a new WordPress project
bash create wordpress-test # wordpress-test is the name of your project
# Checkout an already existing WordPress project
bash checkout wordpress-test # wordpress-test is the name of your project
# Create a new static project
bash create-static static-test # static-test is the name of your project
# Create a new multiple pages static project
bash create-static static-test true # static-test is the name of your project
# Checkout an already existing static project
bash checkout-static static-test # static-test is the name of your project
# Installation and configuration
Skip 1, 2, 3 and 4 if you are on Linux. Instead install Ruby 2+ directly
Install Homebrew (opens new window)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Install rbenv (opens new window)
brew install rbenvInstall the latest Ruby (opens new window) version with
rbenvrbenv install 2.5.0Set the above version of Ruby as global
rbenv global 2.5.0Restart your terminal (using CMD+Q)
Install gitlab's CLI (opens new window)
gem install gitlabYou may need to use
sudoIn your user directory create a
.bash_profilefile if one does not exist. In that file place the following:# Initialize rbenv eval "$(rbenv init -)"Install WP CLI (opens new window) Follow the guide in the docs (opens new window).
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar # then php wp-cli.phar --info # then chmod +x wp-cli.phar # then sudo mv wp-cli.phar /usr/local/bin/wp # then check if everything is ok wp --infoRestart your terminal (using CMD+Q)
# Environment seutp
Create a
env-config.localfile in the root of the repository folder:touch env-config.local && code env-config.localCopy the contents of the
env-configfile into theenv-config.localfile. Edit the variables in the local file as needed:SERVER_NAME=http://scriptex.int # This is your local server's URL SERVER_ROOT=/Users/devmachine1/server/ # This is your local server's root folder PROJECTS_DIR=projects/ # This is your local server's projects folder MAMP_MYSQL=/Applications/MAMP/Library/bin # This is the path to the MAMP's mysql binary executable file STARTER_REPO=git@gitlab.com:three11/wp-starter.git # This is the SSH path to the starter repository STARTER_REPO_STATIC=git@gitlab.com:three11/html-starter.git # This is the SSH path to the starter repository STARTER_REPO_STATIC_MULTI=git@gitlab.com:three11/html-starter-multi.git # This is the SSH path to the multiple pages starter repository GITLAB_TOKEN=o1KGwsidMq_mNzvYWPRU # This is your GitLab access tokenAdd the following export to your
.bash_profileif is is missing:export PATH=$PATH:/Users/YOUR_USER_NAME/server/YOUR_TOOLS_FOLDER/wp-automationRestart your terminal (using CMD+Q)