From 3e4bb2f6ce0a4cf7af5db8b9f3293078863559a6 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Wed, 19 Apr 2023 14:19:06 -0400 Subject: [PATCH 1/2] first steps toward getting started --- docs/tutorial/getting-started.md | 106 +++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 docs/tutorial/getting-started.md diff --git a/docs/tutorial/getting-started.md b/docs/tutorial/getting-started.md new file mode 100644 index 00000000..4ed76e91 --- /dev/null +++ b/docs/tutorial/getting-started.md @@ -0,0 +1,106 @@ +# Getting started + +In this tutorial, you will set up a local version of our WordPress network. + +## Prerequisites + +Please ensure you have the following tools set up on your computer. Everything +can be installed via [Homebrew](https://brew.sh/). + +### PHP + +We currently use the latest release on the 8.0.x branch, using commands such as: + +```bash +$ brew install php@8.0 +``` + +### Composer + +https://getcomposer.org/ + +```bash +$ brew install composer +``` + +The only global package currently needed is PHP CodeSniffer, and the WordPress +coding standards: + +```bash +$ composer global require squizlabs/php_codesniffer +``` + +At this point you should be able to see something like the following output: + +```bash +$ phpcs -i +The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend +``` + +Installing the WordPress code standards should be a process like + +```bash +$ git clone --branch master git@github.com:WordPress/WordPress-Coding-Standards.git ~/code/wpcs +$ phpcs --config-set installed_paths ~/code/wpcs +``` + +You have done everything correctly if you see the following output: + +```bash +$ phpcs -i +The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra +``` + +### Terminus CLI + +https://docs.pantheon.io/terminus + +There are a few packages with this name - you're looking for this one: + +```bash +$ brew install pantheon-systems/external/terminus +``` + +Authenticating via Terminus is documented at https://docs.pantheon.io/terminus/install#authenticate + +Additionally, there are four plugins you'll need: + +- [terminus-build-tools-plugin](https://github.com/pantheon-systems/terminus-build-tools-plugin) +- [terminus-composer-plugin](https://github.com/pantheon-systems/terminus-composer-plugin) +- [terminus-secrets-manager-plugin](https://github.com/pantheon-systems/terminus-secrets-manager-plugin) +- [terminus-secrets-plugin](https://github.com/pantheon-systems/terminus-secrets-plugin) + +The syntax to install each is typically: + +```bash +terminus self:plugin:install plugin-name +``` + +You have done everything correctly when: + +- You see your information with `terminus auth:whoami` +- You see four plugins listed by `terminus self:plugin:list` +- You see at least three entries with `terminus env:list mitlib-wp-network` + +### Lando + +https://lando.dev/ + +```bash +$ brew install --cask lando +``` + +## Set up application + +- git clone mitlib-wp-network +- composer install +- lando pull +- lando wp search-replace command +- lando start +- (optional) lando logs -f + +Get .env from someone + +Set secrets.json values inside Lando (need more words here) + +Load https://mitlib-wp-network.lndo.site/ and see the homepage From 23f1991b6f18ea1258a03811b8b28483b8b6dc34 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Mon, 24 Apr 2023 15:20:11 -0400 Subject: [PATCH 2/2] Add tutorial for advanced Composer setup ** Why are these changes being introduced: * It turns out that part of the setup which I'd included in the Getting Started tutorial may actually not be needed to get started. ** Relevant ticket(s): n/a ** How does this address that need: * This moves the extra bits about setting up PHP CodeSniffer locally, and the WordPress coding standards, to a separate tutorial with a more advanced focus. ** Document any side effects to this change: * Hopefully none --- docs/tutorial/advanced-composer.md | 40 ++++++++++++++++++++++++++++++ docs/tutorial/getting-started.md | 28 --------------------- 2 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 docs/tutorial/advanced-composer.md diff --git a/docs/tutorial/advanced-composer.md b/docs/tutorial/advanced-composer.md new file mode 100644 index 00000000..3e82919d --- /dev/null +++ b/docs/tutorial/advanced-composer.md @@ -0,0 +1,40 @@ +# Advanced setup for Composer + +In this tutorial, you will go beyond the basic Composer setup to include the +full set of WordPress coding standards. + +## Prerequisites + +You should already have completed the [Getting Started](getting-started.md) tutorial. + +## PHP CodeSniffer + +The only global package currently needed is PHP CodeSniffer, and the WordPress +coding standards: + +```bash +$ composer global require squizlabs/php_codesniffer +``` + +At this point you should be able to see something like the following output: + +```bash +$ phpcs -i +The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend +``` + +## WordPress coding standards + +Installing the WordPress code standards should be a process like: + +```bash +$ git clone --branch master git@github.com:WordPress/WordPress-Coding-Standards.git ~/code/wpcs +$ phpcs --config-set installed_paths ~/code/wpcs +``` + +You have done everything correctly if you see the following output: + +```bash +$ phpcs -i +The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra +``` diff --git a/docs/tutorial/getting-started.md b/docs/tutorial/getting-started.md index 4ed76e91..0ed9dff8 100644 --- a/docs/tutorial/getting-started.md +++ b/docs/tutorial/getting-started.md @@ -23,34 +23,6 @@ https://getcomposer.org/ $ brew install composer ``` -The only global package currently needed is PHP CodeSniffer, and the WordPress -coding standards: - -```bash -$ composer global require squizlabs/php_codesniffer -``` - -At this point you should be able to see something like the following output: - -```bash -$ phpcs -i -The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend -``` - -Installing the WordPress code standards should be a process like - -```bash -$ git clone --branch master git@github.com:WordPress/WordPress-Coding-Standards.git ~/code/wpcs -$ phpcs --config-set installed_paths ~/code/wpcs -``` - -You have done everything correctly if you see the following output: - -```bash -$ phpcs -i -The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra -``` - ### Terminus CLI https://docs.pantheon.io/terminus