-
Notifications
You must be signed in to change notification settings - Fork 1
Local development
Note: These instructions are for local development specific to the data catalogue.
- Follow the instructions for setting up a site locally with ddev except instead of creating a new Git repo and downloading the
bcbb-template
Composer file into it, clone theMFIN-Data-Catalogue
repo. Configure config sync. - Get a copy of the database from another environment
Note: we should have a section on how to get a copy of the DB out of OpenShift. Is this something Chris could contribute?
-
ddev import-db --src=/path-to-where-i-saved-the-db/myDb.sql.gz
//import the db -
ddev drush cr
// clear caches -
ddev drush cim -y
// import configurations (config sync) -
ddev launch
// launch the site
This step is optional. Usually you can do development work without getting the files.
- get a copy of the files from another environment
Note: we should have a section on how to get a copy of the files out of OpenShift. Is this something Chris could contribute?
-
ddev import-files --src=/path-to-where-i-saved-the-files
//import the files -
ddev drush cr
// clear caches
Important
Files and data-bases are brought in for development. They are never pushed upstream.
-
git pull
// get the latest -
ddev composer install
// get any new modules or patches -
ddev start
// ddev has to be running -
ddev drush cr
// clear caches -
ddev drush cim
// bring in any new config
- Login to OpenShift CLI with the OpenShift token
-
oc project [project licence plate]
// go to the project (oc exec -i deployment/mfin-data-catalogue-drupal -- pg_dump --no-owner --no-acl -h $DBHOST -U $DBUSER $DBNAME | grep -v "EXTENSION.*pgaudit") > "database-$1-$2.sql"
The feature to download search results requires php8.1-zip. To make it available in your project:
- starting at the root of your project, edit
.ddev/config.yaml
- add the line
webimage_extra_packages: [php8.1-zip]
- save
-
ddev restart
// in terminal
These instructions assume:
- You have a local instance of
MFIN-Data-Catalogue
running locally - You are working with the latest release of the repo, this has the necessary Solr modules and config.
This will install Solr for Drupal 9^. It has been tested and works with Drupal 10.1.0.
-
ddev get ddev/ddev-drupal9-solr && ddev restart
at the root of your project (see ddev-drupal9-solr) -
ddev describe
// see that solr service is running.
There are no Solr credentials tracked in git. The easiest way to manage the local Solr connection is to add it to the local settings file.
If you are using the default ddev Solr set-up, add this to /html/sites/default/settings.local.php
.
// Solr server
$config['search_api.server.solr'] = [
'backend_config' => [
'connector' => 'basic_auth',
'connector_config' => [
'scheme' => 'http',
'host' => 'solr',
'core' => 'dev',
'port' => '8983',
],
],
];
Before you see any search results, you will need to index the site so Solr can build a DB. You can do this at https://mySite.ddev.site/admin/config/search/search-api/index/default_index