seregatte/drupal-composer-boilerplate

Composer template for Drupal 8 projects with docksal

dev-master 2017-12-04 01:27 UTC

This package is not auto-updated.

Last update: 2024-04-23 03:16:47 UTC


README

This project template should provide a kickstart for managing your site dependencies with Composer and infrastructure with Docker via Docksal.

Requirements

  • Docker 1.11+ ->
  • Docker Composer 1.7+ ->
  • PHP cli stack and composer (Optional) ->

Usage

You can create the project via composer or via composer inside a docker.

If you have a php cli stack and composer, try this:

composer create-project seregatte/drupal-composer-boilerplate some-dir --stability dev --no-interaction

or if you prefer run via docker:

docker run --rm -v $(pwd):/app composer/composer create-project seregatte/drupal-composer-boilerplate some-dir --stability dev --no-interaction

With composer require ... or running the same command on docker, you can download new dependencies to your installation.

cd some-dir
composer require drupal/ctools:8.*

or

cd some-dir
docker run --rm -v $(pwd):/app composer/composer require drupal/ctools:8.*

What does the template do?

When installing the given composer.json some tasks are taken care of:

  • Drupal will be installed in the web-directory.
  • Modules (packages of type drupal-module) will be placed in web/sites/all/modules/contrib/
  • Theme (packages of type drupal-module) will be placed in web/sites/all/themes/contrib/
  • Profiles (packages of type drupal-profile) will be placed in web/profiles/
  • Docker stack will be placed in infrastructure/environment/development/docker
  • Makefile will be placed in project's root folder

FAQ

Should I commit the contrib modules I download

Composer recommends no. They provide argumentation against but also workrounds if a project decides to do it anyway.

How can I apply patches to downloaded modules?

If you need to apply patches (depending on the project being modified, a pull request is often a better solution), you can do so with the composer-patches plugin.

To add a patch to drupal module foobar insert the patches section in the extra section of composer.json:

"extra": {
    "patches": {
        "drupal/foobar": {
            "Patch description": "URL to patch"
        }
    }
}