GBirch / massforms8

POC for forms product
1 stars 0 forks source link

Welcome to the fledgling MassForms platform based on Drupal 8.

Getting Started

  1. Clone this repo and checkout the dev branch.
  2. Database setup. Pick a solution:
    1. If using the GovNext Drupal-VM (DVM), this should be already done for you.
    2. Make sure that a local database and database user exists that matches the settings.php file.
    3. Create a settings.local.php file in docroot/sites/demo.massforms8.mass.gov that provides appropriate local database settings.
  3. If using the DVM, vagrant ssh
  4. cd into the project folder; if using the DVM this is cd /var/www/massforms8
  5. Use composer to pull down dependencies (including Drupal core): composer install
  6. Set up development configuration: copy docroot/sites/example.settings.local.php to docroot/sites/demo.massforms8.mass.gov/settings.local.php
  7. cd docroot
  8. Install Drupal and import our config:
    1. 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
    2. 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
    3. 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'
    4. And add -y to answer yes to all questions. Note that this will skip the warning that you are about to nuke your database.
  9. Web Server setup. Pick a solution:
    1. If using the GovNext Drupal-VM, this should be set up for you.
    2. Point Acquia Dev Desktop or other web server at the docroot directory.
    3. ../vendor/bin/drush @demo runserver. This uses PHP's built-in web server.
  10. 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

  1. Add a remote for the Acquia Git repo (if needed) and push to Acquia.
  2. Install Acquia Pipelines (if on Windows, you will need a newish version of Acquia Dev Desktop) and configure (authentication). Acquia Pipelines
  3. Find the application id for the site. pipelines list-applications

Acquia Cloud - Build

  1. Push the relevant branch, usually dev, to Acquia.
  2. 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]
  3. This creates a new "pipelines-build-*" branch.

Acquia Cloud - Deployment

  1. 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
  2. If you are simply updating, then drush @mf8.dev config-import or whatever other deployment steps need to be taken.
  3. 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

  1. To launch a new multisite, create a new database whose name matches the first section of the domain name.
  2. Run site-install per above using new value for --config-dir.

Development Notes

  1. 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.
  2. 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.
  3. Install new modules and themes from contrib by adding them to composer.json, either manually or composer require drupal/module_name "~8.0"
  4. To remove a module after experimenting, a) drush @demo pm-uninstall module_name, THEN b) in the root, composer remove drupal/module_name .
  5. 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.
  6. 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