- Install and start Docker
$ git clone -b develop [email protected]:parliamentwatch/parliamentwatch.git
$ cd parliamentwatch
$ curl -f -u root https://backups.parliamentwatch.org/abgeordnetenwatch.de/abgeordnetenwatch.de_latest.sql.gz > provisioning/var/backup/mysql/abgeordnetenwatch.de_latest.sql.gz
- Only if you are running Docker for Mac or Docker for Windows:
$ echo "XDEBUG_REMOTE_CONNECT_BACK=0" > .env
$ docker-compose up -d
- Open http://localhost:8080 in your browser. It may take a while until the site becomes available during the initial loading of the database backup.
The local development environment is managed with Docker Compose. It consists of containers for the database, solr, web server, drush and a syslog server. The syslog server handles the Drupal watchdog logs. To start the stack run docker-compose up -d
. All logs can be viewed with docker-compose logs
.
In order to populate the database place a backup file downloaded from http://backups.parliamentwatch.org in provisioning/var/backup/mysql
. All files with extensions .sql and .sql.gz will be loaded if the database is not initialised yet. To forget the current state and populate the database from a backup again run docker-compose down --volume
and docker-compose up -d
.
Drush commands can be executed in a command line service container:
$ docker-compose exec web bash
# drush sapi-r politician_archive_index
# drush sapi-i politician_archive_index 0 1000
Please follow these guidelines for commit messages.
Please follow the coding standards and the API documentation and comment standards of the Drupal community.
Theme assets are managed with Grunt tasks. To build the assets initially run the following commands:
$ docker-compose exec web bash
# cd src
# npm install
# node_modules/.bin/grunt build
Translations for contributed and custom modules are managed with Localization update. To update translations for contributed modules update the translations in your development environment with drush l10n-update
and commit the changes. On the live environment updates will only be sourced from the files in sites/all/translations. Translations for custom modules and themes are all stored in the PO file for PW Globals. To update translations for custom modules and themes:
$ docker-compose exec web bash
# drush en potx
# make general.pot
# msgmerge -U -N httpdocs/sites/all/translations/pw_globals-<version>.de.po general.pot
# drush l10n-update-refresh
# drush l10n-update
When the version of PW Globals changes the PO file needs to be renamed accordingly.
We have the Stage File Proxy module enabled so that files that are not found on your local machine are downloaded from the production version. To enable this add the following lines to your settings.php
# File stage proxy $conf['stage_file_proxy_origin'] = 'https://www.abgeordnetenwatch.de'; $conf['stage_file_proxy_origin_dir'] = 'sites/abgeordnetenwatch.de/files';