Skip to content

drupal-switzerland/drupal-ch

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
web
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Drupal Switzerland

Build Status

This project is maintained using Composer and built on Silverback.

For Drupal+Composer related information see:

Project info

URLs:

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

Project Setup

There are two ways to run the project:

  1. Docker with Lagoon
  2. 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.

Docker with Lagoon

  • Prerequisites
    • Make sure you have the latest PHP installed php --version
    • Make sure you have Composer installed composer --version
  • 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 container docker-compose exec cli bash
    • Get master database drush sql-sync @lagoon.master @self
    • Build webpack libraries drush webpack:build

Local PHP server

  • 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
  • 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 run silverback 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

Frontend

Components are developed in Storybook, see Silverback docs for more information.

You can run Storybook locally with npm run storybook.