Skip to content

Detroit Ledger Drupal install profile

Benjamin Chodoroff edited this page Aug 8, 2013 · 5 revisions

Deployment notes

Updating the gnl_schema feature

The gnl_schema feature defines content types, relations, views and other structural components. Most all of this code is autogenerated and maintaned via the Features module. Drush features commands: https://drupal.org/node/960926

Example: commit your changes that you made in a view:

  • in site user interface, edit a view
  • in shell, run “drush features” - it will list all features in the site along with their status. for the feature that contains the view that you modified - hopefully gnl_schema - it will say “Overridden”
  • to preview the changes in that feature, run the command “drush fd gnl_schema”
  • to move the view changes you made from database to code, run “drush fu gnl_schema” - i usually run “git st” in the target feature’s directory to make sure the changes get to live in their own commit.
  • Run “git diff” - the changes should be pretty darn similar to the “drush fd gnl_schema” output that you saw previously!
  • “git add” and “git commit” as needed

If the configuration or structure changes}tract it into the existing repo - just leave the .git dir in place. Alternatively, you can preview the .info file under the “advanced” tab near the bottom left part of the features recreate page, copy in any added lines to the current .info file and run “drush fu gnl_schema” - the features module will read the info file and add in any newly defined components.

Hosting control panel

  • UI commands can also happen with drush, but we’ll stick with using the UI for now:
  • Can add platforms and sites ** A platform is a drupal install from a profile ** For each DL version, we’ll create a new profile ** So, to test deploy, create a platform and add the makefile (can be done straight from github raw url). ** use distro.make with hash (that is -- peg to a version) ** Can create multiple sites for each platform (eg dev and prod sites) ** Specify “Working copy - preserves SCM files” option ** After platform is verified (sanity tests), you can create a site using the new platform, with domain whatever.aegir.detroitledger.org

Rolling a dev platform - how ben did it on june 30th

  • as gnl, created platform in ~/static/gnl_dev with drush make --working-copy https://raw.github.com/detroitledger/gnl_profile/7.x-1.x/distro.make gnl_dev
  • in aegir controlpanel, added site june2013.dev.detroitledger.org using gnl_profile platform
  • made directory ~gnl/csvs and filled it with our import sets

Migrating data

For each deploy we need to migrate in our base data. Included in migrate_gnl is a shell script to download CSVs from our google spreadsheets.

drush en migrate_gnl # it is probably enabled by default though
/path/to/migrate_gnl/download.sh # will download CSVs to /tmp/migrate_gnl
drush mreg
drush ms # make sure the four migrations we're running below are listed!
drush mi GrantTypes
drush mi OrgNTEETypes
drush mi Orgs # the order matters, obvs!
drush mi Grants

This is what success looks like:

gnl@altissima:~/static/gnl-7.x-1.0/sites/aug2013.dev.detroitledger.org$ drush ms

 Group: nodes  Total  Imported  Unprocessed  Status  Last imported
 Orgs          582    0         582          Idle    2013-08-07 17:07:37
 Grants        1641   0         1641         Idle    2013-08-07 17:07:03

 Group: terms  Total  Imported  Unprocessed  Status  Last imported
 GrantTypes    81     0         81           Idle    2013-08-07 17:10:52
 OrgNTEETypes  629    0         629          Idle    2013-08-07 17:11:11

gnl@altissima:~/static/gnl-7.x-1.0/sites/aug2013.dev.detroitledger.org$ drush mi GrantTypes
Processed 81 (81 created, 0 updated, 0 failed, 0 ignored) in 0.8 sec (6359/min) - done with 'GrantTypes' [completed]
gnl@altissima:~/static/gnl-7.x-1.0/sites/aug2013.dev.detroitledger.org$ drush mi OrgNTEETypes
Processed 629 (448 created, 181 updated, 0 failed, 0 ignored) in 12.2 sec (3102/min) - done with 'OrgNTEETypes' [completed]
gnl@altissima:~/static/gnl-7.x-1.0/sites/aug2013.dev.detroitledger.org$ drush mi Orgs
Processed 581 (581 created, 0 updated, 0 failed, 0 ignored) in 20.4 sec (1709/min) - done with 'Orgs' [completed]
gnl@altissima:~/static/gnl-7.x-1.0/sites/aug2013.dev.detroitledger.org$ drush mi Grants
Processed 1641 (1641 created, 0 updated, 0 failed, 0 ignored) in 120.2 sec (819/min) - done with 'Grants' [completed]