Giter VIP home page Giter VIP logo

bedrock-deploy-to-wpengine's Introduction

This code is old and no longer works for Sage v9 and later. Check out Toby's blog post for a solution.


Deploy Roots Bedrock WordPress project to WP Engine hosting platform

Works up to Bedrock 1.7.2. Deploys themes, plugins, and mu-plugins.

Repo: https://github.com/hello-jason/bedrock-deploy-to-wpengine

Changelog

v2 - Removes build process for Sage theme. Now focuses purely on deploying your Bedrock project, regardless of theme. Grab the branch master.

v1 - Works up to Bedrock 1.7.2, Sage 8.5. Grab the branch release/1.0.0.

Description

This bash script prepares a WordPress project built on Root's 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.

The result is a properly-versioned Bedrock repo that you can safely and repeatedly deploy to WP Engine's production and staging environments.

Demo:

Installation & Setup

1. Grab the script

Source code is available at 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

Follow these instructions from WP Engine to setup SSH access and git push for your WP Engine account.

This readme assumes your remotes are named as follows:

  • Production: wpeproduction
  • Staging: wpestaging

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.

Deploy to staging:

bash wpedeploy.sh wpestaging

Deploy to production:

bash wpedeploy.sh wpeproduction

FAQs

  • Which branch does it deploy? - Deploys the local branch you run it on to whichever WP Engine remote you specify (production or staging)
  • What about the uploads directory? - Completely ignores the uploads directory. You'll have to upload that separately via SFTP.
  • 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 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.

bedrock-deploy-to-wpengine's People

Contributors

hello-jason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bedrock-deploy-to-wpengine's Issues

Bad gitignore creation

Change line 90 to:

echo -e '/*\n!wp-content/\nwp-content/uploads' > ./.gitignore

Single quotes let the bang character print properly.

Deploy bedrock site that is also using trellis

The git repo for my project has this file structure:

.git
trellis
site

I placed the bash script inside site and setup the remotes for wpengine. However when I run the script, it pushes the trellis and site folders up to wpe. site/wp-content exists (as expected).

When I view wpe via sftp, I see the following folders at docroot:

site
trellis
wp-admin
wp-content
wp-includes
... other wp core files ...

This is likely because my development git repo isn't the bedrock repo, rather bedrock is within the site folder. Is it possible to deploy based on the relative path of the deploy script?

Check if bower, npm, gulp are installed

The script currently does not confirm if the user has these dependencies before running, and it will fail if they don't. Add these to the checks before it runs.

Check if user has git access

Check if the current system has git push access to the WP Engine repo before branching and moving things. Otherwise, it leaves the user in a bad state on a new branch with files moved all around.

Consider removing theme build support

I am considering removing the pieces of this script that build the website, and solely focusing on deploying to WP Engine.

Each site will most likely have different theme building needs, so you could setup your own build process then call this deploy script via gulp-shell, grunt-shell, or similar methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.