Welcome to the fledgling MassForms platform based on Drupal 8.
Getting Started
- Clone this repo and checkout the dev branch.
- Database setup. Pick a solution:
- If using the GovNext Drupal-VM (DVM), this should be already done for you.
- Make sure that a local database and database user exists that matches the settings.php file.
- Create a settings.local.php file in docroot/sites/demo.massforms8.mass.gov that provides appropriate local database settings.
- If using the DVM,
vagrant ssh
- cd into the project folder; if using the DVM this is
cd /var/www/massforms8
- Use composer to pull down dependencies (including Drupal core):
composer install
- Set up development configuration: copy
docroot/sites/example.settings.local.php
to docroot/sites/demo.massforms8.mass.gov/settings.local.php
cd docroot
- Install Drupal and import our config:
- If using Drupal VM or other Linux-based shell environment with Drush 8.1+ installed:
drush si --uri=http://demo.massforms8.mass.gov minimal --config-dir=../config/demo.massforms8.mass.gov/sync -v
- If using Acquia Dev Desktop:
../vendor/bin/drush si --uri=http://demo.massforms8.mass.gov --db-url=mysql://root:@127.0.0.1:33067/demo_massforms8_mass_gov minimal --config-dir=../config/demo.massforms8.mass.gov/sync -v
- In either event, you can set up the root user with an easy password by adding the following options to the command line:
--account-name=massforms8 --account-pass=massforms8 --site-name='MassForms8 Demo'
- And add
-y
to answer yes to all questions. Note that this will skip the warning that you are about to nuke your database.
- Web Server setup. Pick a solution:
- If using the GovNext Drupal-VM, this should be set up for you.
- Point Acquia Dev Desktop or other web server at the
docroot
directory.
../vendor/bin/drush @demo runserver
. This uses PHP's built-in web server.
- If you have not created an easy password for the root user, get a login link for the root user,
drush @demo uli --no-browser
and open the link in a browser to log in.
Acquia Cloud - Setup
- Add a remote for the Acquia Git repo (if needed) and push to Acquia.
- Install Acquia Pipelines (if on Windows, you will need a newish version of Acquia Dev Desktop) and configure (authentication). Acquia Pipelines
- Find the application id for the site.
pipelines list-applications
Acquia Cloud - Build
- Push the relevant branch, usually dev, to Acquia.
pipelines --application-id=XXXX start
. If run from within your Git repo, this will automatically detect the branch to build. Otherwise you need to specify --vcs-path=[Git branch or tag]
- This creates a new "pipelines-build-*" branch.
Acquia Cloud - Deployment
- If this is a first time install, or you want to delete all of the content, then (from local machine)
drush @mf8.dev si minimal --config-dir=../config/demo.massforms8.mass.gov/sync -v
- If you are simply updating, then
drush @mf8.dev config-import
or whatever other deployment steps need to be taken.
- Note that using the @mf8.dev alias will require use of your ssh key, so running the commands above from within a VM will normally not work.
Acquia Cloud - New Site
- To launch a new multisite, create a new database whose name matches the first section of the domain name.
- Run site-install per above using new value for --config-dir.
Development Notes
- After every pull, run
composer install
to add/subtract any dependencies. You must perform this, and other composer operations, from the root directory of the project.
- After every composer install, cd into the web directory and run
drush cr
. Alternatively, if using the DrupalVM, use the @drupalvm.demo.massforms8.gov drush alias instead of @demo.
- Install new modules and themes from contrib by adding them to composer.json, either manually or
composer require drupal/module_name "~8.0"
- To remove a module after experimenting, a)
drush @demo pm-uninstall module_name
, THEN b) in the root, composer remove drupal/module_name
.
drush use @demo
is a good way to avoid having to type an alias over and over. In order to see what 'site' you have used, run drush init
.
- To use the drupal console with a multisite install, you must pass the --uri= parameter. E.g.:
drupal --uri=demo.massforms8.mass.gov state:debug