This project is maintained using Composer and built on Silverback.
For Drupal+Composer related information see:
- https://github.com/drupal-composer/drupal-project
- https://www.drupal.org/node/2471553
- https://github.com/AmazeeLabs/d8-starter-composer#readme
URLs:
- Local: http://drupal-ch.docker.amazee.io
- Prod: https://drupal.ch or https://nginx-drupal-ch-master.ch.amazee.io
Storybook:
Lagoon UI: https://ui-lagoon-master.ch.amazee.io/project?name=drupal-ch
Development workflow:
- Create a feature branch from
master
- Write code, test locally
- Create a Pull Request against
master
There are two ways to run the project:
Docker with Lagoon
Local PHP server
Which one to use? Docker with Lagoon
is the most reliable way to develop. Local PHP server
is currently used for running automated testing. Use whichever way you are more comfortable with.
- Prerequisites
- Setup
- Install dependencies
composer install
- Start Docker
- Start Pygmy
pygmy up
- Build the containers
docker-compose build
(you need to run this only once, but you may need to re-run it if there are changes to Lagoon setup) - Start the containers
docker-compose up -d
- SSH into the
cli
containerdocker-compose exec cli bash
- Get master database
drush sql-sync @lagoon.master @self
- Build webpack libraries
drush webpack:build
- Install dependencies
- Prerequisites
- Make sure you have installed and configured direnv (don't forget about the setup for your shell). Here is how it should look in case of a correct installation:
me@local:~/Workspace $ cd drupal-ch/ direnv: error .envrc is blocked. Run `direnv allow` to approve its content. me@local:~/Workspace/drupal-ch $ direnv allow direnv: loading .envrc direnv: export +CYPRESS_BASE_URL ... +SB_TEST_CONTENT ~PATH me@local:~/Workspace/drupal-ch $ cd .. direnv: unloading me@local:~/Workspace $ cd drupal-ch/ direnv: loading .envrc direnv: export +CYPRESS_BASE_URL ... +SB_TEST_CONTENT ~PATH
- Make sure you have PHP7 meeting Drupal requirements installed
php --version
- Make sure you have Composer installed
composer --version
- Make sure you have NPM installed
npm --version
- Make sure you have installed and configured direnv (don't forget about the setup for your shell). Here is how it should look in case of a correct installation:
- Setup
- Install dependencies
composer install
- When switching to the project root for the first time, you should see this:
direnv: error .envrc is blocked. Run `direnv allow` to approve its content.
- Run
direnv allow
(it will copy.env.example
to.env
, and load env vars) - Run
silverback setup
to initialize SQLite database and install Drupal from the existing configuration. This has to be done at least once. If there are issues with the command, try to runsilverback clear-cache
first. - Run
drush webpack:build
to build Drupal module libraries - Run
npm run build-library
to build frontend - Start the webserver with
drush serve
- Install dependencies
Components are developed in Storybook, see Silverback docs for more information.
You can run Storybook locally with npm run storybook
.