pantheon-systems / example-drops-8-composer
Install drops-8 with Composer on Pantheon.
Installs: 20 512
Dependents: 0
Suggesters: 0
Security: 0
Stars: 95
Watchers: 57
Forks: 124
Open Issues: 29
Language:Shell
Type:project
Requires
- php: >=7.3
- composer/installers: ^1.9
- cweagans/composer-patches: ^1.7
- drupal/core-composer-scaffold: ^8.8.1
- drupal/core-recommended: ^8.8
- drush-ops/behat-drush-endpoint: ^9.3
- drush/drush: ^8.4.5
- pantheon-systems/drupal-integrations: ^8
- pantheon-systems/quicksilver-pushback: ^2
Requires (Dev)
- behat/behat: ^3.1
- behat/mink: ^1.7
- behat/mink-extension: ^2.2
- dealerdirect/phpcodesniffer-composer-installer: ^0.7
- dmore/behat-chrome-extension: ^1.3
- drupal/coder: ^8.3.1
- drupal/drupal-driver: ^2.1
- drupal/drupal-extension: ^4.1
- genesis/behat-fail-aid: ^2.1
- jcalderonzumba/mink-phantomjs-driver: ^0.3.1
- mikey179/vfsstream: ^1.2
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.4.0
- symfony/css-selector: ^2.8
Conflicts
- dev-master
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.11
- 1.3.10
- 1.3.9
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-clu-2023-01-04-00-03
- dev-clu-2022-12-31-00-04
- dev-bugs-5332
- dev-clu-2022-10-06-00-04
- dev-clu-2022-09-24-00-03
- dev-clu-2022-09-22-00-04
- dev-clu-2021-12-06-00-04
- dev-477-fix-cache
- dev-upgrade-lock-and-add-patch-config
- dev-composer-2
- dev-main
- dev-test-new-container
- dev-update-8.9.1
- dev-prep-for-drupal-9
- dev-clu-2020-06-01-00-10
- dev-drush-8.3.5
- dev-drush-10.2.2
- dev-clu-2020-05-30-00-12
- dev-drush-pre-8.3.4
- dev-drupal-9-drush-10
- dev-clu-2020-03-31-00-17
- dev-clu-2020-05-17-00-21
- dev-drush-8.3.3
- dev-phpunit-6.5
- dev-clu-2020-01-31-00-11
- dev-core-scaffold
- dev-integrated-composer
- dev-drush-10
- dev-clu-2019-12-21-00-10
- dev-remove-redundant-core
- dev-alisonjo315-patch-1
- dev-clu-2019-12-18-23-10
- dev-drupal-880
- dev-clu-2019-12-11-00-10
- dev-rsync-r
- dev-clu-2019-09-28-00-10
- dev-clu-2019-09-10-00-10
- dev-clu-2019-09-07-00-09
- dev-clu-2019-09-04-16-33
- dev-clu-2019-09-03-00-09
- dev-clu-2019-08-07-20-17
- dev-clu-2019-07-17-17-42
- dev-clu-2019-07-04-19-46
- dev-clu-2019-06-11-00-03
- dev-gitlab-vr
- dev-clu-2019-06-05-21-27
- dev-clu-2019-05-26-00-03
- dev-use-pantheon-orb
- dev-clu-2019-05-23-15-43
- dev-clu-2019-05-23-00-02
- dev-clu-2019-05-10-00-01
- dev-clu-2019-05-09-00-02
- dev-clu-2019-05-08-18-10
- dev-clu-2019-05-08-00-02
- dev-clu-2019-05-07-00-02
- dev-clu-2019-05-06-00-02
- dev-clu-2019-05-05-00-02
- dev-clu-2019-05-04-00-02
- dev-clu-2019-05-03-00-02
- dev-clu-2019-05-02-00-02
- dev-clu-2019-04-29-00-03
- dev-clu-2019-05-01-00-01
- dev-min-stable
- dev-clu-2019-04-28-00-04
- dev-clu-2019-04-17-00-01
- dev-8.7.0-beta2
- dev-remove-redundant-dependencies
- dev-clu-2019-04-16-00-02
- dev-circle-config-for-scheduled
- dev-clu-2019-04-06-23-48
- dev-remove-prepare
- dev-clu-2019-04-05-23-44
- dev-clu-2019-04-05-22-53
- dev-clu-2019-04-05-21-54
- dev-bitbucket-pipelines
- dev-compatibility-test
- dev-gitlab-support
- dev-clu-2019-03-20-18-25
- dev-clu-2019-03-14-14-29
- dev-drupal-8.6.10
- dev-drush-9.6-part2
- dev-behat-extension-testing
- dev-drush9.6
- dev-update-drush-behat-endpoint
- dev-clu-2019-01-16-20-23
- dev-shaal-patch-2
- dev-clu-2019-01-03-00-00
- dev-clu-2018-12-05-18-19
- dev-clu-2018-11-07-17-28
- dev-update-8.6.2
- dev-clu-2018-10-17-23-41
- dev-drush9
- dev-update-8.6.1
- dev-update-8.6.0
- dev-update-8.5.6
- dev-drupal-8.5.5
- dev-clu-2018-06-04-08-36
- dev-clu-2018-04-25-17-05
- dev-better-update-instructions
- dev-no-dev
- dev-clu-2018-03-28-20-48
- dev-use-drops-8-scaffolding
- dev-clu-2018-03-07-22-47
- dev-drush-9
- dev-terminus-171
- dev-clu-2018-02-23-18-27
- dev-contenta
- dev-contenta--take2--install-hack
- dev-clu-2017-12-07-16-40
- dev-mc-address
- dev-build-tools-2a4
- dev-clu-2017-11-03-17-37
- dev-drupal-8.4.0
- dev-php-70
- dev-use-script-in-docker
- dev-circle-2.0
- dev-clu-2017-09-06-15-43
- dev-clu-2017-09-06-a152e36
- dev-ratelimit-check
- dev-readme-update
- dev-non-interactive
- dev-redundant-files-ignore
- dev-merge-test-branch
- dev-test
- dev-test-2.x
- dev-git-ignore-file-perms
- dev-prevent-submodules
- dev-modern-commands
- dev-simple-block
- dev-d830
- dev-behat-components
- dev-updatedb
- dev-example-theme
- dev-remove-reinstall
- dev-clone-content
- dev-first-to-dev
- dev-site-install-composer-script
- dev-config-installer
- dev-update-env-vars
- dev-lightning-fist-2
- dev-behat-wait
- dev-dc-workaround
- dev-0e9bashallow-clone
- dev-db0f2shallow-clone
- dev-473aeshallow-clone
- dev-451bfshallow-clone
- dev-composer-merge-pantheon
This package is auto-updated.
Last update: 2024-09-04 03:57:20 UTC
README
This repository is a reference implementation and start state for a modern Drupal 8 workflow utilizing Composer, Continuous Integration (CI), Automated Testing, and Pantheon. Even though this is a good starting point, you will need to customize and maintain the CI/testing set up for your projects.
This repository is meant to be copied one-time by the the Terminus Build Tools Plugin but can also be used as a template. It should not be cloned or forked directly.
The Terminus Build Tools plugin will scaffold a new project, including:
- A Git repository
- A free Pantheon sandbox site
- Continuous Integration configuration/credential set up
For more details and instructions on creating a new project, see the Terminus Build Tools Plugin.
Important files and directories
/web
Pantheon will serve the site from the /web
subdirectory due to the configuration in pantheon.yml
. This is necessary for 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 or being web accessible from Pantheon. They may still be accessible from your version control project if it is public. See the pantheon.yml
documentation for details.
/config
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.
composer.json
This project uses Composer to manage third-party PHP dependencies.
The require
section of composer.json
should be used for any dependencies your web project needs, even those that might only be used on non-Live environments. All dependencies in require
will be pushed to Pantheon.
The require-dev
section should be used for dependencies that are not a part of the web application but are necesarry to build or test the project. Some example are php_codesniffer
and phpunit
. Dev dependencies will not be deployed to Pantheon.
If you are just browsing this repository on GitHub, you may not see some of the directories mentioned above. That is because Drupal core and contrib modules are installed via Composer and ignored in the .gitignore
file.
This project uses the following required dependencies:
-
composer/installers: Relocates the installation location of certain Composer projects by type; for example, this component allows Drupal modules to be installed to the
modules
directory rather thanvendor
. -
drupal/core-composer-scaffold: Allows certain necessary files, e.g. index.php, to be copied into the required location at installation time.
-
drupal/core-recommended: This package contains Drupal itself, including the Drupal scaffold files.
-
pantheon-systems/drupal-integrations: This package provides additional scaffold files required to install this site on the Pantheon platform. These files do nothing if the site is deployed elsewhere.
The following optional dependencies are also included as suggestions:
-
pantheon-systems/quicksilver-pushback: This component allows commits from the Pantheon Dashboard to be automatically pushed back to GitHub for sites using the Build Tools Workflow. This package does nothing if that workflow has not been set up for this site.
-
drush/drush: Drush is a commandline tool that provides ways to interact with site maintenance from the command line.
-
drupal/console: Drupal Console is similar to and an alternative for Drush. You may use either or both.
-
cweagans/composer-patches: Allows a site to be altered with patch files at installation time.
-
drupal/config_direct_save: Provides a way to export configuration directly to the filesystem (in SFTP mode) directly from the Drupal admin interface. This is a convenient way to manage configuration files.
-
drupal/config_installer: Allows a site to be re-installed through the Drupal web installer using existing exported configuration files.
-
drush-ops/behat-drush-endpoint: Used by Behat tests.
-
rvtraveller/qs-composer-installer: Allows a site to install quicksilver hooks from a Composer package.
-
zaporylie/composer-drupal-optimizations: This package makes
composer update
operations run more quickly when updating Drupal and Drupal's dependencies.
Any of the optional dependencies may be removed if they are not needed or desired.
.ci
This .ci
directory is where all of the scripts that run on Continuous Integration are stored. Provider specific configuration files, such as .circle/config.yml
and .gitlab-ci.yml
, make use of these scripts.
The scripts are organized into subdirectories of .ci
according to their function: build
, deploy
, or test
.
Build Scripts .ci/build
Steps for building an artifact suitable for deployment. Feel free to add other build scripts here, such as installing Node dependencies, depending on your needs.
.ci/build/php
installs PHP dependencies with Composer
Build Scripts .ci/deploy
Scripts for facilitating code deployment to Pantheon.
.ci/deploy/pantheon/create-multidev
creates a new Pantheon multidev environment for branches other than the default Git branch- Note that not all users have multidev access. Please consult the multidev FAQ doc for details.
.ci/deploy/pantheon/dev-multidev
deploys the built artifact to either the Pantheondev
or a multidev environment, depending on the Git branch
Automated Test Scripts .ci/tests
Scripts that run automated tests. Feel free to add or remove scripts here depending on your testing needs.
Github Actions Workflows .ci/.github
This folder should be copied to .github folder in root to enable Github Actions. Also, some secrets need to be added to Github Actions configuration.
Static Testing .ci/test/static
and tests/unit
Static tests analyze code without executing it. It is good at detecting syntax error but not functionality.
.ci/test/static/run
Runs PHP CodeSniffer with Drupal coding standards, PHP Unit, and PHP syntax checking.tests/unit/bootstrap.php
Bootstraps the Composer autoloadertests/unit/TestAssert.php
An example Unit test. Project specific test files will need to be created intests/unit
.
Visual Regression Testing .ci/test/visual-regression
Visual regression testing uses a headless browser to take screenshots of web pages and compare them for visual differences.
.ci/test/visual-regression/run
Runs BackstopJS visual regression testing..ci/test/visual-regression/backstopConfig.js
The BackstopJS configuration file. Setting here will need to be updated for your project. For example, thepathsToTest
variable determines the URLs to test.
Behat Testing .ci/test/behat
and tests/behat
Behat is an acceptance/end-to-end testing framework written in PHP. It faciliates testing the fully built Drupal site on Pantheon infrastucture. The Drupal Behat Extension is used to help with integrating Behat and Drupal.
.ci/test/behat/initialize
creates a backup of the environment to be tested.ci/test/behat/run
sets theBEHAT_PARAMS
environment variable with dynamic information necessary for Behat and configure it to use Drush via Terminus and starts headless Chrome, and runs Behat.ci/test/behat/cleanup
restores the previously made database backup and saves screenshots taken by Behattests/behat/behat-pantheon.yml
Behat configuration file compatible with running tests against a Pantheon sitetests/behat/tests/behat/features
Where Behat test files, with the.feature
extension, should be stored. The provided example tests will need to be replaced with project specific tests.tests/behat/tests/behat/features/content.feature
A Behat test file which logs into the Drupal dashboard, creates nodes, users and terms, and verifies their existience in the Drupal admin interface and the front end of the site
Github Actions
If you need to enable Github Actions for an existing project, you should copy .ci/.github to .github and then add the following secrets to Github Actions configuration:
- ADMIN_EMAIL
- ADMIN_PASSWORD
- ADMIN_USERNAME
- TERMINUS_TOKEN
- TERMINUS_SITE
- SSH_PRIVATE_KEY
- GH_TOKEN
Updating your site
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.
Re-enabling automation
The automation which ran daily to check for composer updates has been disabled as of 12/1/22
. Build Tools users can re-enable automation to check for composer updates by uncommenting the scheduled_update_check
in .circleci/config.yml
.