Git Product home page Git Product logo

config-driven-wp's Introduction

Config-Driven WordPress

This repo contains a model for how WordPress projects can be structured in a way that maximizes configurability and minimizes redundancy. This specific structure is what we often use at X-Team.

Dev Setup

You can get up and running quickly via a fork of varying-vagrant-vagrants. Follow the First Vagrant Up instructions, but instead of cloning from the 10up repo, clone from the x-team fork and checkout the auto-site-setup branch:

git clone [email protected]:x-team/varying-vagrant-vagrants.git vvv
cd vvv
git checkout auto-site-setup
vagrant up

If you are already using VVV, you can just add the x-team remote and checkout (or merge from) the branch:

git remote add -f x-team [email protected]:x-team/varying-vagrant-vagrants.git
git checkout -b auto-site-setup x-team/auto-site-setup

You can proceed to add this repo:

cd www
git clone [email protected]:x-team/config-driven-wp.git config-driven-wp.dev
cd config-driven-wp.dev
echo vvv > config/active-env
vagrant reload --provision

Once this finishes (and you've added vvv.config-driven-wp.dev to your hosts file), you should be able to access vvv.config-driven-wp.dev from your browser.

Test DB Dump Updates

This repo includes a lightweight test database dump which contains the necessary content to test the features of the site. In the course of development, if you want to commit some change to the database, first connect with any other developers who are currently working on the site and obtain a "verbal file lock" on database/vvv-data.sql, as merging SQL cannot be done cleanly (see also .gitattributes which explicitly includes *.sql merge=binary). Once you're clear to commit your changes to the database dump, run:

bin/dump-db-vvv
git add database/vvv-data.sql
git commit -m "Add some content X"
git push

Then let the other developers know to:

git pull
bin/load-db-vvv

Do not commit a production database dump! This committed database dump is intended to be lightweight, to have just the minimum of content to facilitate development and testing. Committing a large database dump will greatly increase the repository size.

If any commands complain about needing to be run in Vagrant, you first can vagrant ssh then cd /srv/www/config-driven-wp.dev to run the command. Or, you can set up vassh on your system which allows you to prefix any command on your system to have it executed at the current working directory in the vagrant environment. For example:

vassh wp core upgrade
vassh bin/dump-db-vvv

You can also use the vasshin command similarly—called without arguments it will drop you into the current directory in vagrant (not the vagrant user's home directory); called with an command argument, it will execute the command in the Vagrant environment with full interactive TTY mode and colored output.

WordPress Superadmin User

This user is only for the database dump committed in this repo and does not correspond to any user credentials on any public site:

User: admin
Pass: password

License

As with WordPress core, all code in this repo is licensed GPLv2+.

config-driven-wp's People

Contributors

westonruter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.