- Install Hacking History wordpress distro painlessly
This set of scripts will set up a Wordpress development environment that will work on any major desktop platform (Mac, Windows, Linux). It is designed around the needs of students in [[https://hackinghistory.ca][Hacking History]], a 4th year undergraduate seminar at the Unviersity of Toronto, and based on the work of of [[https://github.com/visiblevc/wordpress-starter][visiblevc]], from which both the docker image and the run scripts are derived.
** How it works
We use [[https://docs.docker.com/][Docker]] and [[http://wp-cli.org/][the Wordpress Command Line Interface]] to construct a "virtual environment" on your laptop. Wordpress and all the other services it depends on (including a webserver and a database server) will run in "containers" which can be accessed through the command line. You can also browse the local Wordpress site by pointing your browser at [[http://localhost:8080][localhost:8080]], and you can edit the theme files in Atom. Any changes you make will be visible in the browser window on refresh.
** Installation
** Usage
- in Atom, edit ~REPOSITORY_ROOT/wp-content/themes/dev-theme/sass/theme/_theme_variables.scss~ or other files in the ~dev-theme~ directory tree. Changes will appear in your browser on refresh.
- if your computer shuts down, run ~docker-compose up && docker-compose logs -f wordpress~ again from the appropriate directory to bring the virtual environment back online. It wil only take about a minute the second time.
** Acknowledgements
- thanks to wordpress-starter for the inspiration and much of the code. Kept it mostly because the color coding is so awesome
- thanks to the official wp-cli image for a starting point
** TODO
- [ ] check whether I can use apt-get or not. If not, need to rewrite the wp-cli code
- [ ] decide how to manage db import and syncing. Might be easier to use a plugin, and maybe (???) even write a row to the db with a secret key passed as an environment variable (that could work with dp-sync, for instance)
- [X] remove all deprecated stuff.
- [X] don't fail if DB already exists. Instead, continue silently.
- [ ] remove multisite stuff, I think
- [X] add a "build-finalizer" for completely local steps. Like, maybe we could add gulp watch.
- [ ] but since this last step will depend on the theme, maybe the smart thing to do is to add this script to the theme repo
- In which case might be better to call it something else.
- like, there might be a ~wp-docker-final-script.sh~ in the foot dir of the theme
- which just does a ~npm install -d && gulp watch~. That would be cool.
- [X] Add node and sass dependencies, either in dockerfile or via docker-compose, with another machine that adds node.