Setup:
- Local server: VM machine runnning Ubuntu
- Staging server: Remote server
- Production server: Another remote server
# Clone Wordpress
Vagrant allows you to quickly set up a headless VM environment (eg. Ubuntu Server + LAMP) on a local machine within Virtualbox (just type vagrant init
+ vagrant up
and you'll have a new VM with SSH running in about 10 minutes). There are several advantages over traditional VM containers, or XAMPP / MAMP / other LAMP sandboxes:
./Vagrantfile
which can be shared with anyone to recreate your environmentvagrant destroy
) and reinitialise a fresh enviroment exactly as you like it, in a matter of minutes - backup your DB's first of course!More at http://www.vagrant.com/
/* https://github.com/roots/roots-sass */
define('WP_ENV', 'development');
//Allow upload of all file types: http://pixert.com/blog/wordpress-file-type-permitted-security-reasons/
define('ALLOW_UNFILTERED_UPLOADS', true);
{ | |
"name": "sage", | |
"homepage": "http://roots.io/sage/", | |
"authors": [ | |
"Ben Word <ben@benword.com>" | |
], | |
"license": "MIT", | |
"private": true, | |
"dependencies": { | |
"modernizr": "~2.8.3", |
{ | |
"name": "sage", | |
"homepage": "http://roots.io/sage/", | |
"authors": [ | |
"Ben Word <ben@benword.com>" | |
], | |
"license": "MIT", | |
"private": true, | |
"dependencies": { | |
"modernizr": "~2.8.3", |
14:13 $ npm install
> ws@0.5.0 install /var/www/clients/drawcard.com.au/wp-content/themes/theme-build-20140215/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/var/www/clients/drawcard.com.au/wp-content/themes/theme-build-20140215/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
#!/usr/bin/env bash | |
bold='tput bold' | |
normal='tput sgr0' | |
# Configure home directory | |
# HOME=/home/vagrant/ | |
HOME=~ | |
echo '***** Check for package updates...' | |
sudo apt-get update |
✔ /var/www/clients/websitename.com.au/wp-content/themes/build [dev L|✚ 1]
01:05 $ npm cache clean
✔ /var/www/clients/websitename.com.au/wp-content/themes/build [dev L|✚ 1]
01:25 $ rm -rf node_modules/
✔ /var/www/clients/websitename.com.au/wp-content/themes/build [dev L|✚ 1]
01:26 $ npm install
npm WARN engineStrict Per-package engineStrict (found in package.json for gulp-concat)
npm WARN engineStrict won't be used in npm 3+. Use the config setting `engine-strict` instead.
npm WARN engineStrict Per-package engineStrict (found in package.json for gulp)
The following procedure was cobbled together from the advice on these pages: