Installation - TincanPipPip/Syd-D9 GitHub Wiki

Requirements

  • DDev - This provides the local development environment
  • Node.js (min version 12.x)

Installation

  1. From the Pantheon dashboard create a new site
    • Choose a concise name for the project
    • Set the organisation to Williams Commerce
    • Set the region to European Union
  2. Choose Syd D9 with media entities or Syd D9 (Spektrix) with media entities[in case you have spektrix integration ] as the upstream
  3. Once complete, visit the dashboard, hit Visit development site and install Drupal
    • Choose Use existing configuration on the profile selection screen
    • Set username to dp_admin, and email to [email protected], ensure a secure password is used
    • Make sure the credentials are saved to TClients
  4. Once installed, in the Pantheon dashboard set the site to run in Git mode
  5. Create a backup in the Pantheon dashboard (you can leave this running whilst you continue the next steps)
  6. Clone the repo to your local machine
  7. From the project root directory run ddev config, entering a site name (use the site name as set in Pantheon), web as Docroot Location and drupal9 as Project type
  8. Run ddev start
  9. Once the container is running, run ddev composer install
  10. Edit ./.ddev/config.yaml L15 to contain your Terminus machine code, e.g:
web_environment: ['TERMINUS_MACHINE_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx']
  1. Duplicate & rename ./.ddev/providers/pantheon.yaml.example to ./.ddev/providers/pantheon.yaml, updating the project name on L42, e.g.
project: <pantheon_site_name>.dev
  1. Run ddev restart
  2. Ensure your changes to ./.ddev/config.yaml aren't tracked in the repo, i.e.
git update-index --assume-unchanged .ddev/config.yaml
  1. Once complete, run ddev pull pantheon (Note: if you haven't run this elsewhere in your current session, you'll be prompted to run ddev auth ssh, this is a once per session task)
  2. Run ddev drush cr
  3. Update ./webpack.mix.js L10 to contain your local development url, e.g.
const hostname = '<site_name>.ddev.site'
  1. Add, commit & push all changes to the repo 🍻

Drush & composer

  • Using drush & composer commands via ddev is just a case of running ddev composer x or ddev drush y

Theming & local development

  • Replace the contents of ./web/sites/development.services.yml with:
parameters:
  http.response.debug_cacheability_headers: true
  twig.config:
    debug: true
    auto_reload: true
    cache: false
services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory
  • Add the following lines to the top of ./web/sites/default/settings.ddev.php
$settings['container_yamls'][] =  DRUPAL_ROOT  .  '/sites/development.services.yml';
$config['system.performance']['css']['preprocess'] =  FALSE;
$config['system.performance']['js']['preprocess'] =  FALSE;
$settings['cache']['bins']['page'] =  'cache.backend.memory';
$settings['cache']['bins']['render'] =  'cache.backend.memory';
$settings['cache']['bins']['dynamic_page_cache'] =  'cache.backend.memory';
  • Run ddev drush cr to clear caches and allow the changes above to take effect

Theme build tools

  • Run npm i from the site root directory
  • Run npm start to begin local development
  • Run npm run-script production before adding/commiting/pushing to the repo
⚠️ **GitHub.com Fallback** ⚠️