From 328ebdd593a16e9922ad672d82a3fee5f96e90a2 Mon Sep 17 00:00:00 2001 From: Jason Cross Date: Thu, 13 Oct 2016 16:58:38 -0500 Subject: [PATCH 1/3] Updates documentation for 2.0.0 --- README.md | 16 +++++++++++----- wpedeploy.sh | 9 ++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f9ab9f0..92827e4 100755 --- a/README.md +++ b/README.md @@ -1,14 +1,19 @@ -# Deploy Bedrock+Sage WordPress project to WP Engine hosting platform +# Deploy Roots Bedrock WordPress project to WP Engine hosting platform Last tested: October 8, 2016 -Works up to Bedrock 1.7.2, Sage 8.5 +Works up to Bedrock 1.7.2 Repo: [https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine](https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine) +## Changelog + +v2 - Removes build process for Sage theme. +v1 - Works up to Bedrock 1.7.2, Sage 8.5 + ## Description -This bash script prepares a WordPress project built on Root's [Bedrock](https://roots.io/bedrock/) boilerplate with the [Sage](https://roots.io/sage/) starter theme and deploys it **to the WP Engine hosting platform**. It can be easily modified if you do not use the Sage theme. +This bash script prepares a WordPress project built on Root's [Bedrock](https://roots.io/bedrock/) boilerplate and deploys it **to the WP Engine hosting platform**. WP Engine expects to see a standard WordPress project in the document root for your account. Since Bedrock shifts folders and files around a bit, this script temporarily moves everything back to their original locations (on a safe, temporary branch), which is then pushed to WP Engine. @@ -16,8 +21,8 @@ The result is a properly-versioned Bedrock repo that you can safely and repeated Demo: -* Demo Bedrock+Sage site on WP Engine: [http://bedrocksage.wpengine.com/](http://bedrocksage.wpengine.com/) -* Demo Bedrock+Sage site repo: [https://github.com/hello-jason/bedrock-sage-on-wpengine-demo](https://github.com/hello-jason/bedrock-sage-on-wpengine-demo) +* Demo Bedrock site on WP Engine: [http://bedrocksage.wpengine.com/](http://bedrocksage.wpengine.com/) +* Demo Bedrock site repo: [https://github.com/hello-jason/bedrock-sage-on-wpengine-demo](https://github.com/hello-jason/bedrock-sage-on-wpengine-demo) ## Installation & Setup @@ -63,3 +68,4 @@ bash wpedeploy.sh wpeproduction * **How does it handle plugin versions?** - You can upgrade or downgrade version numbers in the `composer.json` file, run `composer update`, then run this script to deploy the new version to WP Engine. However, this script **will not delete** plugins from WP Engine's servers; you will have to do that via SFTP or wp-admin. * **What about WordPress core?** - This script only deploys the contents of `wp-content` to WP Engine's servers. You should keep WordPress core updated in your composer file, but that only benefits your local dev environment. You will manage WP core for your publicly-facing site in WP Engine's interface directly. * **Why doesn't it work on Ubuntu?** - It does! But Ubuntu defaults to `dash` rather than `bash`, and the script may fail if you simply run `sh`. Other distros may do the same, so running this script with the `bash` command is important. +* **Why did you remove the build processes for Sagae?** - Since each project will have a different build process for its theme, it makes more sense to focus solely on deploying to WP Engine. More info in [this issue](https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine/issues/13). diff --git a/wpedeploy.sh b/wpedeploy.sh index cefbc4a..e62da07 100755 --- a/wpedeploy.sh +++ b/wpedeploy.sh @@ -1,13 +1,12 @@ #!/bin/bash -# Version: 0.3.1 -# Last Update: February 21, 2016 +# Version: 2.0.0 +# Last Update: October 13, 2016 # -# Description: Bash script to deploy a Bedrock+Sage WordPress project to WP Engine's hosting platform +# Description: Bash script to deploy a Bedrock WordPress project to WP Engine's hosting platform # Repository: https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine.git # README: https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine/blob/master/README.md # -# Tested Bedrock Version: 1.5.3 -# Tested Sage Version: 8.4.2 +# Tested Bedrock Version: 1.7.2 # Tested bash version: 4.3.42 # Author: Jason Cross # Author URL: http://hellojason.net/ From 62f66b50d3ca1f00b3df97382bd7e5d1842fe95f Mon Sep 17 00:00:00 2001 From: Jason Cross Date: Thu, 13 Oct 2016 22:25:23 -0500 Subject: [PATCH 2/3] Removes references to Sage theme --- wpedeploy.sh | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/wpedeploy.sh b/wpedeploy.sh index e62da07..91629dd 100755 --- a/wpedeploy.sh +++ b/wpedeploy.sh @@ -11,12 +11,6 @@ # Author: Jason Cross # Author URL: http://hellojason.net/ ######################################## -# PLEASE EDIT -# Your theme directory name (/web/app/themes/yourtheme) -themeName="sage" -######################################## - -#################### # Usage #################### # bash wpedeploy.sh nameOfRemote @@ -64,16 +58,6 @@ if [ "$?" -ne 0 ]; then exit 1 fi -# Directory checks -#################### -# Halt if theme directory does not exist -if [ ! -d "$presentWorkingDirectory"/web/app/themes/"$themeName" ]; then - echo -e "[\033[31mERROR\e[0m] Theme \"$themeName\" not found.\n Set \033[32mthemeName\e[0m variable in $0 to match your theme in $bedrockThemesDirectory" - echo "Available themes:" - ls $bedrockThemesDirectory - exit 1 -fi - #################### # Begin deploy process #################### @@ -91,41 +75,6 @@ echo -e "/*\n!wp-content/" > ./.gitignore # Copy meaningful contents of web/app into wp-content mkdir wp-content && cp -rp web/app/plugins wp-content && cp -rp web/app/themes wp-content -# Go into theme directory -cd "$presentWorkingDirectory/wp-content/themes/$themeName" &> /dev/null - -# Build theme assets -npm install && bower install && gulp --production - -# Back to the top -cd "$presentWorkingDirectory" - -# Cleanup wp-content -#################### -# Remove sage theme cruft -# Files -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/.bowerrc &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/.editorconfig &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/.gitignore &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/.jscsrc &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/.jshintrc &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/.travis.yml &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/bower.json &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/gulpfile.js &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/package.json &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/composer.json &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/composer.lock &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/ruleset.xml &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/CHANGELOG.md &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/CONTRIBUTING.md &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/LICENSE.md &> /dev/null -rm "$presentWorkingDirectory"/wp-content/themes/"$themeName"/README.md &> /dev/null -# Directories -rm -rf "$presentWorkingDirectory"/wp-content/themes/"$themeName"/node_modules &> /dev/null -rm -rf "$presentWorkingDirectory"/wp-content/themes/"$themeName"/bower_components &> /dev/null -rm -rf "$presentWorkingDirectory"/wp-content/themes/"$themeName"/assets &> /dev/null -rm -rf "$presentWorkingDirectory"/wp-content/themes/"$themeName"/vendor &> /dev/null - #################### # Push to WP Engine #################### From 6c32dfa237e8e2b10667fd77b63bea1b705bcf9f Mon Sep 17 00:00:00 2001 From: Jason Cross Date: Sat, 15 Oct 2016 09:41:54 -0500 Subject: [PATCH 3/3] Removes references to Sage theme --- README.md | 20 ++++++-------------- wpedeploy.sh | 6 +++--- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 92827e4..ebdc3f2 100755 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # Deploy Roots Bedrock WordPress project to WP Engine hosting platform -Last tested: October 8, 2016 - Works up to Bedrock 1.7.2 -Repo: [https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine](https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine) +Repo: [https://github.com/hello-jason/bedrock-deploy-to-wpengine](https://github.com/hello-jason/bedrock-deploy-to-wpengine) ## Changelog -v2 - Removes build process for Sage theme. +v2 - Removes build process for Sage theme. Now focuses purely on deploying your Bedrock project, regardless of theme. v1 - Works up to Bedrock 1.7.2, Sage 8.5 ## Description @@ -21,14 +19,14 @@ The result is a properly-versioned Bedrock repo that you can safely and repeated Demo: -* Demo Bedrock site on WP Engine: [http://bedrocksage.wpengine.com/](http://bedrocksage.wpengine.com/) -* Demo Bedrock site repo: [https://github.com/hello-jason/bedrock-sage-on-wpengine-demo](https://github.com/hello-jason/bedrock-sage-on-wpengine-demo) +* Demo Bedrock site on WP Engine: [http://rootsbedrock.wpengine.com/](http://rootsbedrock.wpengine.com/) +* Demo Bedrock site repo: [https://github.com/hello-jason/bedrock-on-wpengine-demo](https://github.com/hello-jason/bedrock-on-wpengine-demo) ## Installation & Setup ### 1. Grab the script -Source code is available at [https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine](https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine). This repo is not meant to be cloned into your project. Rather, just grab the `wpedeploy.sh` file and place it in the top-level directory of your Bedrock project, and keep it with your project's repo. +Source code is available at [https://github.com/hello-jason/bedrock-deploy-to-wpengine](https://github.com/hello-jason/bedrock-deploy-to-wpengine). This repo is not meant to be cloned into your project. Rather, just grab the `wpedeploy.sh` file and place it in the top-level directory of your Bedrock project, and keep it with your project's repo. ### 2. Setup git push @@ -39,12 +37,6 @@ This readme assumes your remotes are named as follows: * **Production**: wpeproduction * **Staging**: wpestaging -### 3. Set theme variable - -Out the box, this script assumes your theme's name is **sage**. Open `wpdeploy.sh` and change the following variable (around line 17). - -* Set `themeName` to the **directory name** of your theme (/app/themes/**yourthemename**) - ## Usage Run at the **top level** of your project, in the same directory as your `.env` and `composer.json` files. Replace each remote name with the ones you created during step 1. @@ -68,4 +60,4 @@ bash wpedeploy.sh wpeproduction * **How does it handle plugin versions?** - You can upgrade or downgrade version numbers in the `composer.json` file, run `composer update`, then run this script to deploy the new version to WP Engine. However, this script **will not delete** plugins from WP Engine's servers; you will have to do that via SFTP or wp-admin. * **What about WordPress core?** - This script only deploys the contents of `wp-content` to WP Engine's servers. You should keep WordPress core updated in your composer file, but that only benefits your local dev environment. You will manage WP core for your publicly-facing site in WP Engine's interface directly. * **Why doesn't it work on Ubuntu?** - It does! But Ubuntu defaults to `dash` rather than `bash`, and the script may fail if you simply run `sh`. Other distros may do the same, so running this script with the `bash` command is important. -* **Why did you remove the build processes for Sagae?** - Since each project will have a different build process for its theme, it makes more sense to focus solely on deploying to WP Engine. More info in [this issue](https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine/issues/13). +* **Why did you remove the build processes for Sage?** - Since each project will have a different build process for its theme, it makes more sense to focus solely on deploying to WP Engine. More info in [this issue](https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine/issues/13). diff --git a/wpedeploy.sh b/wpedeploy.sh index 91629dd..a704fd4 100755 --- a/wpedeploy.sh +++ b/wpedeploy.sh @@ -1,10 +1,10 @@ #!/bin/bash # Version: 2.0.0 -# Last Update: October 13, 2016 +# Last Update: October 15, 2016 # # Description: Bash script to deploy a Bedrock WordPress project to WP Engine's hosting platform -# Repository: https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine.git -# README: https://github.com/hello-jason/bedrock-sage-deploy-to-wpengine/blob/master/README.md +# Repository: https://github.com/hello-jason/bedrock-deploy-to-wpengine.git +# README: https://github.com/hello-jason/bedrock-deploy-to-wpengine/blob/master/README.md # # Tested Bedrock Version: 1.7.2 # Tested bash version: 4.3.42