Outreach: May First's internal CiviCRM database

May First maintains our own CiviCRM installation via a standard hosting order using the address outreach.mayfirst.org.

It’s running CiviCRM Standalone.

Code base

The entire site (except the public and `private’ file directories) is kept in git.

The main code we maintain is in the “mayfirst” CiviCRM extension. This code provides our custom membership workflow, displays, scheduled jobs, reports and other functionality.

Tests

Note: running tests in this manner is no longer working. Needs a fix!

Our custom CiviCRM extension has a tests directory that can be used to ensure our custom membership functionality is working after an upgrade.

To setup your system to run tests, take these one time steps:

  1. Ensure you have a working local copy of the Outreach CiviCRM database.
  2. Download the cv tool.
  3. Create your cv.json file (see setup, mostly you have to edit the TEST_DB_DSN value, adding a username and password with root access to your database and a database name that will be used for the tests).
  4. Install phpunit.
  5. Change into the mayfirst extension’s directory
  6. For each file in tests/phpunit/Civi/Mayfirst/ (except MayfirstBase.php) run: phpunit /path/to/test.

Extensions

Always install copy of database locally and test on local copy first.

The extensions are in the web/ext directory and included in the git repo. But, with the exception of our custom extensions, they are downloaded via the UI.

Custom

We maintain two extensions directly in the outreach git repo:

  • mayfirst: holds all of our custom code.
  • gowanus: simple extension providing our public facing theme overrides.

You can make changes directly to these files and commit them in git.

Contrib

When upgrading or installing new contrib extensions:

  • upgrade/install via the CiviCRM UI
  • test
  • commit changes
  • push changes to live
  • run cv --user=admin upgrade:db

Core Upgrades

  1. Delete the core directory.
  2. Download the upgraded version and unpack it.
  3. Run cv upgrade:db
  4. Update language files: `Administer -> Localization -> Languages, Currency, Locations -> “Update Language Files” (button)
  5. Test locally
  6. Commit changes and push to live
  7. Run cv upgrade:db on live site.
  8. Update language files: `Administer -> Localization -> Languages, Currency, Locations -> “Update Language Files” (button)