Git Product home page Git Product logo

nws-wp's Introduction

Bedrock + PHP Server + Livereload

mkdir projectname/ && cd projectname/
git clone [email protected]:OutThisLife/NWS-WP.git .
composer install
touch .env

Setup database credentials for .env and then run yarn dev to start a PHP server, livereload server, and to listen to all css/js changes.

SSH work flow

Let your server build your WP site for you via git.

On the server

$ mkdir nws-wp.git && cd nws-wp.git
$ git init --bare
$ vim hooks/post-receive

post-receive:

#!/bin/sh
echo "********************"
echo "Build initiated"
echo "********************"

DIR=/home/<username>/public_html/nws-wp
GIT_WORK_TREE=$DIR git checkout -f

echo "Changing permissions for $DIR"

cd $DIR && composer install
chown -hR apache:apache $DIR

Your local setup

$ git init
$ git remote add live ssh://[email protected]/home/<username>/public_html/nws-wp.git
$ git remote add origin [email protected]:<username>/nws-wp.git

WPEngine work flow

First, you have to enable git on your WPE install as well as a staging environment.

Your remotes should ideally look something like this:

$ git remote -v
origin  [email protected]:outthislife/reponame.git (fetch)
origin  [email protected]:outthislife/reponame.git (push)
production      [email protected]:production/reponame (fetch)
production      [email protected]:production/reponame (push)
staging [email protected]:staging/reponame (fetch)
staging [email protected]:staging/reponame (push)

You need remotes setup as above in order to manage your VC. Staging will be where you push most of your changes up, but all of your git work will remain mostly on bitbucket. This is because WPE will automatically deploy any push to their git servers despite the branch name.

To bypass this, you use the origin remote to manage your branches and then just deploy to whichever WPE environment you need once ready.

With this setup, and on any branch, you can deploy via yarn deploy to staging and yarn golive to production.

nws-wp's People

Contributors

outthislife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.