- Always create Feature and Bugfix branches from the
mainbranch. - When needed, create Hotfix branches from
live. - Merge, or submit a Pull Request, from Feature/Bugfix/Hotfix branches to
integrationfor Development/Integration environment deployments. - Submit a Pull Request from Feature/Bugfix branches to
mainfor QA/Staging environment deployments. - Submit a Pull Request from Hotfix branches to
livefor Production environment deployments. - Submit a Pull Request from
maintolivefor all regular Production releases.
To set up the local environment, do the following:
-
Install
dockeranddocker-compose, if not already installed. -
Install
DDEV -
Clone this repository.
git clone git@github.com:forumone/wordpress-faustjs-project.git
-
Create a
.envin the project root directory for local development. See the.env.localfile for an example. (NOTE: You will need to supply valid license keys and/or download URLS in the PLUGIN LICENSE KEYS section for premium plugins to install.) -
Private Composer repository access.
-
Get an API Token for the repository.
- Forum One Developer: Find the "F1 WP Composer Repo Key" entry in Bitwarden for API token.
- Vendor/Client: Get the API token from your Forum One point of contact.
-
Create an
auth.jsonfile in the project root directory. -
Enter the access detail into the
auth.jsonfile.{ "http-basic": { "satispress.forumone.dev": { "username": "<API Token>", "password": "<API Token Password>" } } } -
Confirm the
auth.jsonfile is listed in the.gitignorefile in the project root directory to ensure that it doesn’t get committed to the git repository.
-
-
Run:
ddev start
- Install WordPress core and plugins.
ddev composer install
- Install theme development dependencies and build.
ddev gesso install
ddev gesso build
-
Retrieve a copy of an environment(Dev/Stage/Live) database and unpack to
./export.sqlThe database file can be named anything, but you'll need to know the file name for the next step. You can also leverage the Forum One or Pantheon hosting DDev providers to import the database and skip step 10.- Forum One Hosting:
ddev auth ssh && ddev pull f1- Copy your machine SSH config to the DDev global settings directory.
mkdir ~/.ddev/homeadditions/.ssh && cp ~/.ssh/config ~/.ddev/homeadditions/.ssh/
ddev auth ssh && ddev pull f1
- Pantheon Hosting:
ddev auth ssh && ddev pull pantheon
- Forum One Hosting:
-
Import the database.
ddev wp db import export.sql
- Fix local DB URLs.
ddev wp search-replace '<environment domain>' '<PROJECT_ID>.ddev.site' --all-tables
- Flush the cache.
ddev wp cache flush
- Load the environment configuration.
ddev wp config pull all
- Initial app setup:
cd app
cp .env.local.example .env.local
nvm use
npm ci
-
Connect Faust and Next. Open Faust settings and:
- Set the Front-end site URL to http://localhost:3000
- Save the Secret Key to FAUST_SECRET_KEY in
app/.env.local
-
Start the frontend (in
app/):
npm run dev
- More info in the
app/README.md
- Like Gesso, the custom blocks plugin has been equipped with ddev commands. To prepare the block plugin, begin by running the install.
ddev customblocks install
- Build the plugin files
ddev customblocks build
- To run the plugin build in watch mode you can run the following
ddev customblocks dev
- Additional commands can be found in .ddev/commands/customblocks
- Build the theme assets.
ddev gesso build
- Watch for changes
ddev gesso watch
- Dev:
- Stage:
- Prod:
This project will push app artifacts to a separate repository.
- To enable
ddev xdebug on - To disable xdebug
ddev xdebug off
Following linting tools are available for local development with their current commands:
phpstan>ddev phpstan> Uses config filephpstan.neon.dist.phpcs>ddev phpcs> Runs standard command outlined in the.phpcs.xml.disteslint>ddev gesso eslint> Only scans the theme folder. (Default: web/themes/gesso)stylelint>ddev gesso stylelint> Only scans the theme folder. (Default: web/themes/gesso)
These commands can be found in the following directory: .ddev/commands/web & .ddev/commands/gesso
Additional documentation for linting, including setting up your IDE to reporting on issues as your making changes, can be found in Confluence in the Tech Team Linting section.
With DDev 1.19 there was a service that was included called Mutagen. Mutagen allows for a 2 way sync for the code base into a docker container.
Some of the things to think about when using Mutagen
- Uses a lot more disk space
- Can get out of sync if you run
npm installfor the first time,composer installinstalling a lot of new packages, and hugegitoperations- To re-sync
ddev mutagen sync - To monitor mutagen
ddev mutagen monitor
- To re-sync
Reference: Mutagen documentation
To enable mutagen for a specific project please create a file .ddev/config.mutagen.yaml DO NOT COMMIT THIS FILE.
mutagen_enabled: trueNOTE: Note mutagen is only really intended for Mac OS, but it may also be used on Windows.