Skip to content

UniversityofHelsinki/thinkopen-d8

Repository files navigation

Druid Drupal 8 project template

About the site

  • Public root in is public folder
  • Configuration is in conf folder
  • Custom modules are in public/modules/custom folder
  • Custom themes are in public/themes/custom folder

Contrib modules included

These recommended modules are included in the composer.json, but you can remove them if not needed.

Setup a new local environment

By default we'll use Docker based environment.

Requirements

Create and start the environment

Change the hostname in docker-compose.yml file:

E.g. mysite.fi.docker.amazee.io to yoursite.fi.docker.amazee.io

For the first time (new project member):

$ composer build-init

Then create and start the environment:

$ composer build-dev

Login to Drupal container

This will log you inside the Drupal Docker container and in the public folder:

$ docker-compose exec --user drupal drupal bash

Move to project root:

$ cd ..

Build codebase

This will download Drupal core, contrib modules and setup configuration. See Composer section below.

$ composer build-dev

Install a new site

Install the site using the standard profile:

$ bin/drush -r public si standard

Enable additional modules:

$ bin/drush -r public en admin_toolbar pathauto swiftmailer system_status -y

CHANGE ME! Replace this with sync instructions when you have environments where to sync from.

Build tools

Composer

This template uses Composer to build the codebase.

Installations rely on composer.lock file. This can be updated by running composer build-dev which will update the lock file. Lock file us used by testing/staging/production builds and will not be updated then.

Build codebase with dev requirements and update composer.lock file:

$ composer build-dev

Build codebase without dev requirements using composer.lock file and optimized autoloader:

$ composer build-production|build-testing|build-staging

npm

We use npm's shrinkwrap command to lock the list of installed packages. This ensures the exact same package versions being installed across different environments.

See package.json and npm-shrinkwrap.json.

Quality Assurance

Tests

Run all tests and checks

$ composer test

Run unit tests (PHPUnit)

$ composer test-unit

Run static PHP checks

$ composer test-static-php

Run static JS checks

$ composer test-static-js

Run behavioral tests (Behat)

$ composer test-behavioral

PHPUnit

Drupal uses PHPUnit for unit, integration, and behavioral tests. See the documentation for more information about Drupal's usage of PHPUnit.

This template supports all PHPUnit-based tests, with the exception of functional-javascript tests (built on \Drupal\FunctionalJavascriptTests\JavaScriptTestBase). Submodules are unsupported, because their tests cannot be detected automatically.

Behat

Behat is used for behavioral testing. Its configuration and the features to test are located in ./behat.

Automated builds

Travis CI is used to run all automated analyses and tests for pull requests (PRs) and pushes. Sensitive data MUST be encrypted. To instruct Travis CI to act on changes to a particular repository, go to the Integration & services section of its settings page on Github, and follow the instructions when adding Travis CI integration. Also update env.global in ./.travis.yml with project-specific values.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published