From 044ab9746d68f5918ad191804acef27730adeec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flurin=20Du=CC=88rst?= Date: Fri, 23 Dec 2016 10:55:21 +0100 Subject: [PATCH] add wpdistillery subfolder, add custom Vagrantfile --- .gitignore | 3 +-- Vagrantfile | 27 ++++++++++++++++++++++++ config.yml => wpdistillery/config.yml | 0 wpdistillery/provision.sh | 24 +++++++++++++++++++++ setup.sh => wpdistillery/wpdistillery.sh | 12 +++++++---- 5 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 Vagrantfile rename config.yml => wpdistillery/config.yml (100%) create mode 100644 wpdistillery/provision.sh rename setup.sh => wpdistillery/wpdistillery.sh (96%) diff --git a/.gitignore b/.gitignore index 693938f..7dae414 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ .vagrant config_custom.yml npm-debug.log -public -Vagrantfile +public \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..6f86b13 --- /dev/null +++ b/Vagrantfile @@ -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 diff --git a/config.yml b/wpdistillery/config.yml similarity index 100% rename from config.yml rename to wpdistillery/config.yml diff --git a/wpdistillery/provision.sh b/wpdistillery/provision.sh new file mode 100644 index 0000000..c7d5f60 --- /dev/null +++ b/wpdistillery/provision.sh @@ -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 diff --git a/setup.sh b/wpdistillery/wpdistillery.sh similarity index 96% rename from setup.sh rename to wpdistillery/wpdistillery.sh index d3bfba6..6b579a0 100644 --- a/setup.sh +++ b/wpdistillery/wpdistillery.sh @@ -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 @@ -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 @@ -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"