Skip to content

Commit

Permalink
add wpdistillery subfolder, add custom Vagrantfile
Browse files Browse the repository at this point in the history
  • Loading branch information
flurinduerst committed Dec 23, 2016
1 parent 6693749 commit 044ab97
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
.vagrant
config_custom.yml
npm-debug.log
public
Vagrantfile
public
27 changes: 27 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# WPDistillery Vagrantfile for Scotch Box
#
# File Version: 1.0

Vagrant.configure("2") do |config|

config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "wpdsrc.dev" # can i read this form config? #
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

# Run Provisioning (update wp cli, set upload size to 64MB, run WPDistillery)
# executed within the first `vagrant up` and every `vagrant provision`
config.vm.provision "shell", path: "wpdistillery/provision.sh"

# Update WordPress and all Plugins on vagrant up
# executed within every `vagrant up`
config.vm.provision "shell",
inline: "echo \"== Update WordPress & Plugins ==\" && cd /var/www/public && wp core update && wp plugin update --all", run: "always", privileged: false

# Enable NFS
# config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }

end
File renamed without changes.
24 changes: 24 additions & 0 deletions wpdistillery/provision.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# WPDIstillery provisioning file
#
# Author: Flurin Dürst » github.com/flurinduerst
# URL: https://github.com/flurinduerst/WPDistillery
# Note: created with WPDistillery 2.0.0
#
# File version 1.0.0

# update WP-CLI
echo "== Update WP CLI =="
sudo wp cli update --yes --allow-root

# set upload size to 64MB
echo "== Update Max Filesize =="
sudo sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 64M/g' /etc/php5/apache2/php.ini
sudo sed -i 's/post_max_size = 8M/post_max_size = 64M/g' /etc/php5/apache2/php.ini
sudo service apache2 restart

# run WPDistillery
echo "== Run WPDistillery =="
cd ../../var/www/wpdistillery
sudo -u vagrant bash wpdistillery.sh
12 changes: 8 additions & 4 deletions setup.sh → wpdistillery/wpdistillery.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env bash
#
# WP SETUP FILE
# WPDistillery setup file
#
# Author: Flurin Dürst » github.com/flurinduerst
# URL: https://github.com/flurinduerst/WPDistillery
# Note: was setup.sh until WPDistillery 2.0.0
#
# File version 1.6.3
# File version 1.7.0

# ERROR Handler
# ask user to continue on error
Expand Down Expand Up @@ -57,8 +58,11 @@ NC='\033[0m' # no color

printf "${BRN}========== WPDISTILLERY START ==========${NC}\n\n"

# MOVE TO SYNCED DIRECTORY
cd ..

# READ CONFIG
eval $(parse_yaml config.yml "CONF_")
eval $(parse_yaml wpdistillery/config.yml "CONF_")

# CHECK WP FOLDER
if [ ! -d "$CONF_wpfolder" ]; then
Expand Down Expand Up @@ -152,9 +156,9 @@ if $CONF_setup_cleanup ; then
fi
if $CONF_setup_cleanup_themes ; then
printf "${BLU}»»» removing default themes...${NC}\n"
wp theme delete twentyfourteen
wp theme delete twentyfifteen
wp theme delete twentysixteen
wp theme delete twentyseventeen
fi
else
printf "${BLU}>>> skipping Cleanup...${NC}\n"
Expand Down

0 comments on commit 044ab97

Please sign in to comment.