Skip to content

Threespot/threespot-wp-sandbox

Repository files navigation

Threespot WordPress Sandbox

CircleCI Dashboard threespot-wp-sandbox Dev Site threespot-wp-sandbox WordPress Core

Outline

Pantheon Environments

Local Development

In order to more easily recreate the production environment locally, Lando is used for local development. We also use Pantheon’s CLI, Terminus, to sync files and databases.

Prerequisites

Install all the required local dependencies:

You'll also need write access to this repo and be a member of the Pantheon Project.

Installation

  1. Clone the Repo $ git clone https://github.com/Threespot/fix-me.git
  2. Install Application Composer Dependencies $ composer install
  3. Install Theme Composer Dependencies
    • Navigate to the sage theme directory $ cd web/wp-content/themes/sage
    • Install Componser deps $ composer install
  4. Install Theme Node Dependencies
    • Navigate to the sage theme directory $ cd web/wp-content/themes/sage
    • Install Node deps $ yarn install from the theme directory

Boot WordPress Application

With all the dependencies installed, from the root project directory run:

lando start

If this is the first time running this command, Lando will build the necessary Docker containers.

To stop the server run:

lando stop

Other Lando CLI command can be read here in the Lando docs

Boot Theme (Vite) Server

Making CSS or JS updates requires running Vite to recompile and inject the CSS and JS.

NOTE: If you’re the first developer to work on this site, you’ll need to generate self-signed local dev certificates so Vite can use https. Run $ mkcert threespot-wp-sandbox.lndo.site and place the two .pem files in the /sage/certs folder.

  1. Navigate to the theme folder $ cd /web/wp-content/themes/sage

  2. Install npm dependencies using Yarn $ yarn install

  3. Start Vite $ yarn start

  4. You should now have live reload enabled on http://threespot-wp-sandbox.lndo.site

  5. To stop the server, press Control + C

Pull Files and Database from Pantheon

Lando is used to pull uploads and data from Pantheon. See docs here.

lando pull --database=test --files=test --code=none

Deploying

Code committed to the remote master branch is automatically deployed to the dev environement on Pantheon. After a local branch is pushed, CircleCI will build and deploy the files to Pantheon’s dev environment. You can tell CircleCI to not run by adding [skip ci] to the commit message.

Code that exists on dev can be promoted to the test enviroment, and test can be promoted to the live environment. Details about the application lifecycle can be read here. Feature branches with a corresponding pull request will create a multi-dev enviroment used for testing indiviual features. Docs are available here

Deployment Using Terminus

Test Environment

Code will be promoted from dev to test

lando composer run-script deploy:test

NOTE: this composer script will also purge Pantheon's cache.

or

lando terminus env:deploy fix-me.test

Live Environment

Code will be promoted from test to live

lando composer run-script deploy:live

or

lando terminus env:deploy fix-me.live

About

WordPress Sandbox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5