This repository is a start state for a Composer-based Drupal workflow with Pantheon. It is meant to be copied by the the Terminus Build Tools Plugin which will set up for you a brand new
- GitHub repo
- Free Pantheon sandbox site
- A CircleCI configuration to run tests and push from the source repo (GitHub) to Pantheon.
For more background information on this style of workflow, see the Pantheon documentation.
Pantheon will serve the site from the /web
subdirectory due to the configuration in pantheon.yml
, facilitating a Composer based workflow. Having your website in this subdirectory also allows for tests, scripts, and other files related to your project to be stored in your repo without polluting your web document root.
One of the directories moved to the git root is /config
. This directory holds Drupal's .yml
configuration files. In more traditional repo structure these files would live at /sites/default/config/
. Thanks to this line in settings.php
, the config is moved entirely outside of the web root.
When using this repository to manage your Drupal site, you will no longer use the Pantheon dashboard to update your Drupal version. Instead, you will manage your updates using Composer. Ensure your site is in Git mode, clone it locally, and then run composer commands from there. Commit and push your files back up to Pantheon as usual.
We will keep the Github repo for Imagine Lexington and the Pantheon codebase in sync and therefore will need two remote urls for this project locally. Refer to the documentation on Pantheon to help with setting that up.
Development will go through Github for feature branches and pull requests, then code, can be sent up to Pantheon's dev environment after merged into Github.
Local development requires the use of Lando. Specifically, version v3.0.0-beta.47 was used for set up of this build. The specific version is the latest stable release of the software and can be found on Github.
Create a local.settings.php in /sites/default/ (which is ignored by git).
It should include:
if (getenv('LANDO') === 'ON') {
$lando_info = json_decode(getenv('LANDO_INFO'), TRUE);
$settings['trusted_host_patterns'] = ['.*'];
$settings['hash_salt'] = md5(getenv('LANDO_HOST_IP'));
$databases['default']['default'] = [
'driver' => 'mysql',
'database' => $lando_info['database']['creds']['database'],
'username' => $lando_info['database']['creds']['user'],
'password' => $lando_info['database']['creds']['password'],
'host' => $lando_info['database']['internal_connection']['host'],
'port' => $lando_info['database']['internal_connection']['port'],
];
}
(JOSH) Drush was not executing correctly for me so I followed the steps from this comment on a thread in Github for Lando Issues.
Additionally I had to chmod to 755, the drush directory in that usr/local/bin
location.
If you want to turn twig debugging on and cache off be sure to make your development.services.yml look like this:
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
(NOTE: This can slow local page maneuvering down quite a bit. So disble the debug and turn cache back on if you want to speed things up a little bit.)
Lando will use the .lando.yml file to set up your local environment. A simple lando start
and then a lando pull
should connect you to the Pantheon build.
You may have to generate a machine token for Lando on Pantheon. To do so go to Pantheon Dashboard --> Account --> Machine Tokens to generate a token for the Lando Machine.
Run terminus auth:login --machine-token=<token>
to authenticate the local development machine. Then run lando pull
.
Visit www.mysite.com/imce and upload all images for heros and icons to [content_type_machine_name]/images/. Naming is very important.
- Taxonomy Terms (3 different vocabularies)
- Goals (21)
- Objectives (84)
- Policies (222)
- Pillars (237)
- Themes (242)
- Dev Types (250)
- Place Types (257)
- Criteria (347)
- General Page (354)